private initPipes() {
if (![ImportStatus.SUCCESS, ImportStatus.FAILURE].includes(this.event?.status)) {
interval(this.dataPollingIntervalSec * 1000)
.pipe(
takeWhile(() => this.alive && this.continuePolling),
switchMap(() => {
const observables = [
this.importStatusService
.getDetails(this.event.executionId)
.pipe(tap((event) => (this.event = event))),
this.selectActionObservable(this.event.status),
];
return forkJoin(observables);
}),
)
.subscribe(() => this.cd.detectChanges());
}
}
This part of code produces a typeError
I caught the Error and it seems that forkJoin(observables) is undefined and cannot be returned by switchMap but in debugger, it's not undefined but its an observable