@Component({
selector: 'test',
template: `...`,
})
export class TestComponent {
one$;
two$;
constructor( private store: Store<any>, private element : ElementRef ) {}
ngOnInit() {
this.one$ = store.select("data").subscribe(data => // do something);
this.two$ = Observable.interval(1000).subscribe(data => // do something);
}
ngOnDestroy() {
this.one$.unsubscribe();
this.two$.unsubscribe();
}
}