Redux中间件Redux-thunk的配置
2024-09-01 17:10:28
当做固定写法吧
截图里少一个括号,已代码为主
import {createStore,applyMiddleware,compose} from 'redux'
import thunk from 'redux-thunk'
import reducer from './reducer' const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):compose const enhancer = composeEnhancers(applyMiddleware(thunk))
// const store = createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())
const store = createStore(reducer, enhancer)
export default store
最新文章
- 不一样的dynamic解析json 万能方法
- android原生ExpandableListView
- error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用
- iOS-工作经验+资料分享(长期更新)
- trackr: An AngularJS app with a Java 8 backend – Part III
- 430flash的操作
- 教程-Delphi 调用控制面板设置功能
- OOM-killer 线上设置 +vm +OOM机制
- OpenJDK1.8 安装
- OC - 3.OC的三大特性
- [PWA] Enable Push Notification in your web app
- 一个封装HTTP请求的函数(C++)
- new thoughts over function pointers
- SWFUpload文件上传详解
- Java虚拟机定义
- UOJ14 UER #1 DZY Loves Graph(最小生成树+并查集)
- 团队项目:Recycle
- hMailServer配置图文详细教程
- C#编写CLR函数
- 【API知识】ElementUI一些问题的解决方案