summaryrefslogtreecommitdiff
path: root/client/src/store.ts
blob: 18b3461e995512c3d2b402cd4ed0b1c545f5de49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { configureStore } from '@reduxjs/toolkit';
import { apiSlice } from './slices/apiSlice';
import authReducer from './slices/authSlice';

const store = configureStore({
  reducer: {
    [apiSlice.reducerPath]: apiSlice.reducer,
    auth: authReducer,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware().concat(apiSlice.middleware),
});

export default store;
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;