I have a couple of methods in the form of
getFirstDataBunch() {
return this.repository.getData(this.parameter).pipe(
switchMap(
result => {
//Do something with result;
return of(true);
}
)
);
}
Which I then call on my ngOnInit
as:
function ngOnInit(){
forkJoin(this.getFirstDataBunch(), this.getSecondDataBunch(), this.getThirdDataBunch()).subscribe(
results => {
//do stuff with results;
}
);
}
I can see that all the observables are being called, and they return an observable, however the forkJoin
Subscribe method is never called, from what I've read forkJoin
fires only when all observables return and are finished, and I do believe that to be the case, so why is not firing?
I've also seen that some people simply go for combineLatest
, but because these methods only return once I don't really need to keep looking for updates on them.