import TakeUntilDestroy from "angular2-take-until-destroy";
@Component({
selector: 'app-inbox',
templateUrl: './inbox.component.html'
})
@TakeUntilDestroy
export class InboxComponent {
componentDestroy;
constructor( ) {
const timer$ = Observable.interval(1000)
.takeUntil(this.componentDestroy())
.subscribe(val => console.log(val))
const timer2$ = Observable.interval(2000)
.takeUntil(this.componentDestroy())
.subscribe(val => console.log(val))
}
}