From 541298f3194d15b978dc0e3a0c49df747e6130eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BA=BA=E7=BB=9D=E4=B8=8D=E4=B8=BA?= =?UTF-8?q?=E5=A5=B4?= Date: Thu, 21 Aug 2025 09:45:46 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E6=AE=B5=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 67f54c6..2bc0ebb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,3 +1,23 @@ +// 古老写法 +// // 1. 导入原始 Redux 的核心函数 +// import { createStore, combineReducers } from 'redux'; +// // 2. 导入 reducers(保持不变) +// import loadingReducer from "./slices/loadingSlice"; +// import studentReducer from "./slices/studentSlice"; + +// // 3. 合并 reducers +// const rootReducer = combineReducers({ +// loading: loadingReducer, +// student: studentReducer, +// }); + +// // 4. 创建 store(原始 Redux 方式) +// export default createStore( +// rootReducer, +// // 可选:添加 Redux DevTools 支持 +// window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +// ); + import { configureStore } from "@reduxjs/toolkit"; import loadingReducer from "./slices/loadingSlice"; import studentReducer from "./slices/studentSlice";