I have my observable with interval and takeuntil which is working fine in angular 5. Now When I update it to angular 6 and rxjs6, it is failing. I changed from Observable.interval to interval but takeuntil is not working. I need takeuntil because, I need to stop this observable when the component is destroyed.
import { Observable, Subject } from "rxjs";
private onDestroy$ = new Subject<void>();
Observable.interval(600000).takeUntil(this.onDestroy$).subscribe(x => {
// do something
});
ngOnDestroy() {
this.onDestroy$.next();
}