Before I had this resolver that just worked fine:
resolve() {
return forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
Thanks to @Sajeetharan by looking to this url ended up using exhaustMap
resolve() {
return this.actions$.pipe(
ofActionSuccessful(LoadOnPremHostSuccess),
exhaustMap(() => {
return forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
);
})
);
}
Use exhaustMap
operator. It maps to inner observable, ignore other values until that observable completes
import { forkJoin } from 'rxjs';
import { exhaustMap } from 'rxjs/operators';
resolve() {
return this.actions$
.pipe(
ofActionSuccessful(SomeSctonSuccess),
exhaustMap(() => {
return forkJoin(
this.getData1(),
this.getData2(),
this.getData3()
)
})
);
}