22301014 | bc4616f | 2025-06-03 16:59:44 +0800 | [diff] [blame^] | 1 | import { configureStore } from '@reduxjs/toolkit' |
2 | |||||
3 | export const store = configureStore({ | ||||
4 | reducer: { | ||||
5 | |||||
6 | } | ||||
7 | }) | ||||
8 | |||||
9 | // 从 store 本身推断出 `RootState` 和 `AppDispatch` 类型 | ||||
10 | export type RootState = ReturnType<typeof store.getState> | ||||
11 | // 推断出类型: {posts: PostsState, comments: CommentsState, users: UsersState} | ||||
12 | export type AppDispatch = typeof store.dispatch |