4
我刚刚开始了解@ ngrx/store和@ ngrx.effects,并在我的Angular/Ionic应用程序中创建了我的第一个效果。它第一次运行正常,但如果我再次将事件发送到商店(即再次单击该按钮),则什么都不会发生(没有网络调用,控制台日志中没有任何内容)。有什么明显的我做错了吗?这里的效果:@ngrx效果不会第二次运行
@Effect() event_response$ = this.action$
.ofType(SEND_EVENT_RESPONSE_ACTION)
.map(toPayload)
.switchMap((payload) => this.myService.eventResponse(payload.eventId,payload.response))
.map(data => new SentEventResponseAction(data))
.catch((error) => Observable.of(new ErrorOccurredAction(error)));
感谢
这是否意味着使用Angular的全局错误处理程序将无法使用效果? https://stackoverflow.com/questions/47896171/is-it-possible-to-throw-errors-inside-ngrx-effects-without-completing-the-observ –
谢谢!这对我有效 – Divya