import { configureStore } from '@reduxjs/toolkit' import cakeReducer from '../features/cake/cakeSlice' import icecreamReducer from '../features/icecream/icecreamSlice' import userReducer from '../features/user/userSlice' const store = configureStore({ reducer: { cake: cakeReducer, icecream: icecreamReducer, user: userReducer } }) export default store // Infer the `RootState` and `AppDispatch` types from the store itself export type RootState = ReturnType // Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState} export type AppDispatch = typeof store.dispatch