blob: 5f3841ed3c0d92422927670e1c926a7a79fba2e4 [file] [log] [blame]
import { configureStore } from '@reduxjs/toolkit'
import authReducer from "../feature/auth/authSlice"
export const store = configureStore({
reducer: {
auth: authReducer,
},
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(),
})
// 从 store 本身推断出 `RootState` 和 `AppDispatch` 类型
export type RootState = ReturnType<typeof store.getState>
// 推断出类型: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch