1 import { Component, Input, OnChanges } from '@angular/core'
2 import { Observable } from 'rxjs'
3 import { Video } from '@app/shared/video/video.model'
4 import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
5 import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store'
6 import { User } from '@app/shared'
9 selector: 'my-recommended-videos',
10 templateUrl: './recommended-videos.component.html'
12 export class RecommendedVideosComponent implements OnChanges {
13 @Input() inputRecommendation: RecommendationInfo
16 readonly hasVideos$: Observable<boolean>
17 readonly videos$: Observable<Video[]>
20 private store: RecommendedVideosStore
22 this.videos$ = this.store.recommendations$
23 this.hasVideos$ = this.store.hasRecommendations$
26 public ngOnChanges (): void {
27 if (this.inputRecommendation) {
28 this.store.requestNewRecommendations(this.inputRecommendation)
33 this.store.requestNewRecommendations(this.inputRecommendation)