-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.ts
24 lines (22 loc) · 822 Bytes
/
store.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';
import metaReducer from '../features/meta/metaSlice';
import playersReducer from '../features/players/playersSlice';
import gameReducer from '../features/game/gameSlice';
import scoreboardReducer from '../features/scoreboard/scoreboardSlice';
import { StoreSliceName } from './constants';
export const store = configureStore({
reducer: {
[StoreSliceName.Meta]: metaReducer,
[StoreSliceName.Players]: playersReducer,
[StoreSliceName.Game]: gameReducer,
[StoreSliceName.Scoreboard]: scoreboardReducer,
},
});
export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
ReturnType,
RootState,
unknown,
Action<string>
>;