你应该在 Redux 中间件中多次发送或调用 next 吗?

Should you dispatch or call next multiple times inside of a Redux middleware?

我很好奇,我在中间件中看到过,例如 redux-promise-middleware 我们希望单个操作触发多个操作(例如请求、成功、失败)。但是,在中间件中,我们提供了 dispatch 以便能够 dispatch 这些操作。在 dispatch(action) 上使用 next(action) 调用这些附加操作是否有理由?

如果您发送一个动作,那么它将再次经过所有中间件链。另一方面,next 只是将它发送到链中的下一个中间件,或者如果没有更多的中间件,则直接发送到 reducer。