You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
469 B
19 lines
469 B
// index.ts 文件
|
|
|
|
import { configureStore } from "@reduxjs/toolkit";
|
|
import counterSlice from "./features/counterSlice";
|
|
import contextSlice from "./features/contextSlice";
|
|
|
|
// configureStore创建一个redux数据
|
|
const store = configureStore({
|
|
// 合并多个Slice
|
|
reducer: {
|
|
counter: counterSlice,
|
|
context: contextSlice,
|
|
},
|
|
});
|
|
|
|
export default store;
|
|
|
|
export type RootState = ReturnType<typeof store.getState>
|
|
export type AppDispatch = typeof store.dispatch
|