After receiving the initial request response, I need to perform three parallel requests in my ngrx Effect. I implemented the following, however when I inspect it using the network tab, all three requests are queued. and all queries are executed sequentially.
I WANT TO MAKE THREE PARALLEL REQUESTS.
HOW TO VERIFY WHETHER A FORK JOIN RESULT IS UNDEFINED OR NOT.
fetchDataTotallyWhenUserLogIn$ = createEffect(() => { return this.actions$.pipe( ofType(fetchDefaultSitePerUser), switchMap(() => { return FIRST REQUEST (params) .pipe( this.startWithTap(() => this.store.dispatch(setLoadingSpinner({showLoading: true}))), filter(firstReqResponse=> firstReqResponse!== undefined), tap(firstReqResponse => { if (firstReqResponse === null) { throw "The user's default site has not been assigned." } else { sessionStorage.setItem(Foo, JSON.stringify(firstReqResponse)); } }), map(firstReqResponse => firstReqResponse), concatMap(firstReqResponse => //I NEED MAKE FOLLOWING REQUESTS AS PARALLEL forkJoin([ PARALLEL_REQUEST_01(firstReqResponse ), PARALLEL_REQUEST_02(firstReqResponse ), PARALLEL_REQUEST_03(firstReqResponse ) ]).pipe( filter(response => response !== undefined), map(([PARALLEL_REQUEST_01_RESP, PARALLEL_REQUEST_02_RESP, PARALLEL_REQUEST_03_RESP]) => { return LastAction( { a: PARALLEL_REQUEST_01_RESP, b: PARALLEL_REQUEST_02_RESP, c: PARALLEL_REQUEST_03_RESP, d: firstReqResponse }) }) ) ), // Catch errors thrown above catchError(this.exceptionRxjs.handleRxJsError), finalize(() => this.store.dispatch(setLoadingSpinner({showLoading: false}))) ) }) )})