【问题标题】:Action doesn't trigger effect the THIRD time when it runs动作在运行时不会触发第三次效果
【发布时间】: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


【解决方案1】:

我也有类似的问题。问题出在我的减速机上。在我的减速器中发生了一些未处理的错误,结果,效果停止工作。

如果没有其他解决方案有效,您能否检查一下这是否也是您的问题?

【讨论】:

  • 我认为这可能是你的问题。
猜你喜欢
  • 2019-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-14
相关资源
最近更新 更多