尚硅谷-react教程-求和案例-@redux-devtools/extension 开发者工具使用-笔记

cs 复制代码
## 7.求和案例_react-redux开发者工具的使用
    (1).npm install @redux-devtools/extension
    (2).store中进行配置
        import { composeWithDevTools } from '@redux-devtools/extension';
        export default createStore(allReducer,composeWithDevTools(applyMiddleware(thunk)))
  • src/redux/store.js
cs 复制代码
/*
*  该文件专门用于暴露一个store对象,整个应用只有一个store对象
* */

// store.js
//引入createStore,专门用于创建redux中最为核心的store对象
import {createStore,applyMiddleware,combineReducers} from 'redux'
//引入为Count组件服务的reducer
import countReducer from './reducers/count'
//引入为Person组件服务的reducer
import personReducer from './reducers/person'
//引入redux-thunk,用于支持异步action
import {thunk} from 'redux-thunk'
//引入redux-devtools-extension
import { composeWithDevTools } from '@redux-devtools/extension';

// 合并多个reducer
const allReducer = combineReducers({
    he:countReducer,
    rens:personReducer
})
//导出store
export default createStore(allReducer,composeWithDevTools(applyMiddleware(thunk)))

推荐和参考阅读文章:

安装和使用 Redux DevTools 插件-CSDN博客https://blog.csdn.net/huangjuan0229/article/details/136901744

相关推荐
@zulnger2 分钟前
python 学习笔记(循环)
笔记·python·学习
Hammer_Hans8 分钟前
DFT笔记16
笔记
菩提祖师_11 分钟前
量子机器学习在时间序列预测中的应用
开发语言·javascript·爬虫·flutter
我命由我1234513 分钟前
开发中的英语积累 P25:Axis、Stroke、Corner、Interceptor、Declared、Internal
经验分享·笔记·学习·职场和发展·求职招聘·职场发展·学习方法
未来之窗软件服务20 分钟前
幽冥大陆(九十二 )Gitee 自动化打包JS对接IDE —东方仙盟练气期
javascript·gitee·自动化·仙盟创梦ide·东方仙盟
名字越长技术越强21 分钟前
html\css\js(一)
javascript·css·html
扑火的小飞蛾24 分钟前
【Ansible学习笔记01】 批量执行 shell 命令
笔记·学习·ansible
hunter145025 分钟前
2026.1.4 html简单制作
java·前端·笔记·html
ヤ鬧鬧o.27 分钟前
IDE风格的布局界面
javascript·html5
hxjhnct30 分钟前
React 为什么不采用(VUE)绑定数据?
javascript·vue.js·react.js