This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| view: Array<number> = []; | |
| constructor(private media: ObservableMedia) {} | |
| ngOnInit() { | |
| this.media.asObservable() | |
| .pipe(takeUntil(this.ngUnsubscribe)) | |
| .subscribe((change: MediaChange) => { | |
| this.changeGraphSize(); | |
| }); | |
| this.changeGraphSize(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class myComponent { | |
| private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1); | |
| constructor( | |
| private serviceA: ServiceA, | |
| private serviceB: ServiceB, | |
| private serviceC: ServiceC) {} | |
| ngOnInit() { | |
| this.serviceA | |
| .takeUntil(this.destroyed$) | |
| .subscribe(...); |