simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 1 | import { configureStore } from '@reduxjs/toolkit'; |
| 2 | import appReducer from './appSlice'; |
idillon | d858c18 | 2022-09-16 13:18:26 -0400 | [diff] [blame] | 3 | |
| 4 | export const store = configureStore({ |
| 5 | reducer: { |
| 6 | app: appReducer, |
| 7 | }, |
| 8 | }); |
| 9 | |
| 10 | // Infer the `RootState` and `AppDispatch` types from the store itself |
| 11 | export type RootState = ReturnType<typeof store.getState>; |
| 12 | // Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState} |
| 13 | export type AppDispatch = typeof store.dispatch; |