Files
teach_sys_Demo/src/store/index.js

31 lines
904 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 古老写法
// // 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,
},
});