Redux 异步

处理异步、调试工具🔧、更优雅的和react结合
Redux处理异步,需要redux-thunk组件(比较简单的)npm install redux-devtools-extention并开启🔛(调试工具🔧)使用
react-redux优雅的链接🔗react和redux
处理异步
Redux默认只处理同步,异步任务需要
react-thunk中间件npm install redux-thunk --save使用
applyMiddleware开启thunk中间件Action可以返回函数,使用dispatch提交action
index.js
index.redux.js
App.js
最后更新于
这有帮助吗?