We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
原 createStore ———— │ ↓ return enhancer1(createStore)(reducer, preloadedState, enhancer2) | ├———————→ createStore 增强版 1 │ ↓ return enhancer2(createStore1)(reducer, preloadedState, enhancer3) | ├———————————→ createStore 增强版 1+2 │ ↓ return enhancer3(createStore1+2)(reducer, preloadedState, applyMiddleware(m1,m2,m3)) | ├————————————————————→ createStore 增强版 1+2+3 │ ↓ return appleMiddleware(m1,m2,m3)(createStore1+2+3)(reducer, preloadedState) | ├——————————————————————————————————→ 生成最终增强版 store
感觉图中enhancer的第二次调用应该去掉吧。因为createStore调用的是compose返回的函数(称func),func被调用让enhancer被串联执行,在这个过程中,enhancer应该只有一次调用,func(createStore) => enhancer(createStore),后面的第二次调用应该是所有enhaner执行完成,返回最终版store,在原始createStore内,执行finalCreateStore(reducer, preloadedState)
func(createStore) => enhancer(createStore)
finalCreateStore(reducer, preloadedState)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
感觉图中enhancer的第二次调用应该去掉吧。因为createStore调用的是compose返回的函数(称func),func被调用让enhancer被串联执行,在这个过程中,enhancer应该只有一次调用,
func(createStore) => enhancer(createStore)
,后面的第二次调用应该是所有enhaner执行完成,返回最终版store,在原始createStore内,执行finalCreateStore(reducer, preloadedState)
The text was updated successfully, but these errors were encountered: