Redux 中间件中的 dispatch 和 next 有什么区别? [英] What's the difference between dispatch and next in Redux middleware?
本文介绍了Redux 中间件中的 dispatch 和 next 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
export default function sampleMiddleware(store) {
return next => action => {
store.dispatch(action)
next(action)
}
}
推荐答案
Dispatch 启动新的操作,并通过完整的中间件链.
Dispatch initiates new action and it's go through full chain of middlewares.
Next – 将当前操作发送到链中的下一个中间件.
Next – send current action into next middleware in chain.
这篇关于Redux 中间件中的 dispatch 和 next 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文