尚硅谷-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

相关推荐
Keep Running *2 分钟前
Django_学习笔记
笔记·学习·django
今天你TLE了吗3 分钟前
LLM到Agent&RAG——AI概念概述 第五章:Skill
人工智能·笔记·后端·学习
qq_120840937138 分钟前
Three.js 工程向:后处理性能预算与多 Pass 链路优化
前端·javascript
南棱笑笑生43 分钟前
20260422给万象奥科的开发板HD-RK3576-PI适配瑞芯微原厂的Buildroot时使用mpg123播放mp3音频
前端·javascript·音视频·rockchip
乙酸氧铍1 小时前
【imx6ul 学习笔记】移植ubuntu 20.04系统
笔记·学习·ubuntu
鱼鳞_1 小时前
Java学习笔记_Day37(网络编程)
java·网络·笔记·学习
nunumaymax1 小时前
【第三章-react 应用(基于 react 脚手架)】
前端·react.js·前端框架
空中海1 小时前
第一章:Vue 基础与模板语法
前端·javascript·vue.js
mCell1 小时前
为什么我不建议初学者一上来就用框架学 Agent
javascript·langchain·agent