效果在前两次 Action 调度中完美运行,但在第三次时不会触发。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()),
)
),
);
最佳答案
我也遇到了类似的问题。问题出在我的 reducer 上。在我的 reducer 中发生了一些未处理的错误,因此效果停止工作。
如果没有其他解决方案,您能否检查一下您的情况是否也存在这个问题?
关于javascript - 操作第三次运行时未触发效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56753826/