redux中间件的pending success有意义吗

redux中间件的pending success有意义吗 


德玛西亚99
浏览 724回答 1
1回答

慕尼黑8549860

dispatch(action) 等于 composedABC(action) 等于执行 function A(action) {...}在函数 A 中执行 next(action), 此时 A 中 next 为 composedBC,那么等于执行 composedBC(action) 等于执行function B(action){...}在函数 B 中执行 next(action), 此时 B 中 next 为 composedC,那么等于执行 composedC(action) 等于执行function C(action){...}在函数 C 中执行 next(action), 此时 C 中 next 为 store.dispatch 即 store 原生的 dispatch, 等于执行store.dispatch(action)store.dispatch 会执行 reducer 生成最新的 store 数据所有的 next 执行完过后开始回溯执行函数 C 中 next 后的代码执行函数 B 中 next 后的代码执行函数 A 中 next 后的代码整个执行 action 的过程为 A -> B -> C -> dispatch -> C -> B -> A
打开App,查看更多内容
随时随地看视频慕课网APP