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