【问题标题】:redux-observable 2.0.0 - replacing action$.ofType() with pipeable operatorredux-observable 2.0.0 - 用 pipeable 运算符替换 action$.ofType()
【发布时间】:2021-09-09 21:41:46
【问题描述】:

现在,在 2.0.0 版中,action$.ofType() 已被删除以支持可管道操作符,我该如何实现以下目标

        return obs.pipe(
          takeUntil(ofType(actionCreator.cancel.TYPE)),
          map(payload => actionCreator.success(payload, meta)),
          catchError(error => of(actionCreator.failure(error, meta))),
        )

【问题讨论】:

    标签: redux rxjs redux-observable


    【解决方案1】:

    经过一番调查,我发现了以下作品

            return obs.pipe(
              takeUntil(action$.pipe(ofType(actionCreator.cancel.TYPE))),
              map(payload => actionCreator.success(payload, meta)),
              catchError(error => of(actionCreator.failure(error, meta))),
            )
    

    【讨论】:

      猜你喜欢
      • 2022-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-08
      • 2012-09-14
      • 1970-01-01
      • 1970-01-01
      • 2018-10-08
      相关资源
      最近更新 更多