I am dispatching two actions and no need to execute sequentially. I tried below code:
@Effect()
loadIntResponse$ =
this.actions.ofType(fromActions.LOAD_INT_RESPONSE).pipe(
switchMap(() => {
return this.Service.int().pipe(
tap(x => this.store.dispatch(new fromActions.LoadService(x))),
map(responseResult => {
return new fromActions.LoadIntResponseSuccess(responseResult)
}),
catchError(error => {
let err: responseResult = {
status: "FALSE",
message: error
}
return of(new fromActions.LoadIntResponseFail(err))
})
)
})
)
loadService$ = this.actions.ofType(fromActions.Load_Service).pipe(
switchMap((action: fromActions.LoadService) => {
if (action.payload.status == 'TRUE' {
return this.reuseService.reuseServiceCall().pipe(
map( result ==> {
return of({type: fromActions.LOAD_SERVICE_SUCCESS, payload:
result})
}),
catchError(error => {
let err: responseResult = {
status: "FALSE",
message: error
}
return of(new fromActions.LoadServiceFail(err))
})
)
})
)
But it is not triggering another effect LoadService()
Expected Result: Trigger another effect LoadService()
LoadService accept any type parameter.
I really appreciate for the help. Thank you!