【发布时间】:2019-06-25 12:15:00
【问题描述】:
Effects 在前两次调度动作时完美运行,但在第三次不触发。Why action doesn't trigger Effect the second time it runs 和 @ngrx Effect does not run the second time 中的解决方案对我不起作用。效果如下:
@Effect()
getRoomsByRoomsList: Observable<IAction> = this.actions$.pipe(
ofMap(commonEuropeanParliamentActions.GET_ROOMS_BY_ROOMS_LIST),
withLatestFrom(this.store, (action, state) => ({state: state, action: action})),
exhaustMap((pAction: IStateAction) =>
this.getRooms(pAction).pipe(
switchMap((entity: any) => [
commonEuropeanParliamentActions.getSuccessRoomsByRoomsList(entity),
commonEuropeanParliamentActions.getSchedule(entity)
]),
catchError(() => of()),
)
),
);
【问题讨论】:
-
你真的想要exhaustMap吗?为什么不合并地图?
-
@Knostradamus 它在 mergeMap 中不起作用。
标签: javascript angular angular7 ngrx ngrx-effects