Effects runs perfectly on first two dispatch of action but doesn’t trigger on the third time.The solution in Why action doesn’t trigger Effect the second time it runs and @ngrx Effect does not run the second time doesn’t work for me. Here’s the effect:
JavaScript
x
15
15
1
@Effect()
2
getRoomsByRoomsList: Observable<IAction> = this.actions$.pipe(
3
ofMap(commonEuropeanParliamentActions.GET_ROOMS_BY_ROOMS_LIST),
4
withLatestFrom(this.store, (action, state) => ({state: state, action: action})),
5
exhaustMap((pAction: IStateAction) =>
6
this.getRooms(pAction).pipe(
7
switchMap((entity: any) => [
8
commonEuropeanParliamentActions.getSuccessRoomsByRoomsList(entity),
9
commonEuropeanParliamentActions.getSchedule(entity)
10
]),
11
catchError(() => of()),
12
)
13
),
14
);
15
Advertisement
Answer
I also had a similar problem. The issue was with my reducer. In my reducer some error occurred which wasn’t handled, as a result, the effect stopped working.
Could you check if that’s the issue in your case too, if no other solutions worked?