31 lines
904 B
JavaScript
31 lines
904 B
JavaScript
|
|
// 古老写法
|
|||
|
|
// // 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";
|
|||
|
|
|
|||
|
|
export default configureStore({
|
|||
|
|
reducer: {
|
|||
|
|
loading: loadingReducer,
|
|||
|
|
student: studentReducer,
|
|||
|
|
},
|
|||
|
|
});
|