summaryrefslogtreecommitdiff
path: root/frontend/src/reducers.ts
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-03 01:27:22 +0200
committerjbion <joffrey.bion@amadeus.com>2019-05-06 18:33:14 +0200
commit0d09d870d9adf789232a5e6165f44c605839833a (patch)
tree304cabb01f2b3a9b9afd338f784d957a5a55dd48 /frontend/src/reducers.ts
parentConvert redux actions to typescript (diff)
downloadseven-wonders-0d09d870d9adf789232a5e6165f44c605839833a.tar.gz
seven-wonders-0d09d870d9adf789232a5e6165f44c605839833a.tar.bz2
seven-wonders-0d09d870d9adf789232a5e6165f44c605839833a.zip
Convert reducers to typescript
Diffstat (limited to 'frontend/src/reducers.ts')
-rw-r--r--frontend/src/reducers.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/frontend/src/reducers.ts b/frontend/src/reducers.ts
new file mode 100644
index 00000000..679bffe1
--- /dev/null
+++ b/frontend/src/reducers.ts
@@ -0,0 +1,25 @@
+// @flow
+import { routerReducer } from 'react-router-redux';
+import { combineReducers } from 'redux';
+import { ApiPlayer } from './api/model';
+import { CurrentGameState } from './redux/currentGame';
+import { createCurrentGameReducer } from './redux/currentGame';
+import { GamesState } from './redux/games';
+import { createGamesReducer } from './redux/games';
+import { currentUserReducer } from './redux/user';
+
+export type GlobalState = {
+ currentGame: CurrentGameState;
+ currentUser: ApiPlayer | null;
+ games: GamesState;
+ routing: any;
+}
+
+export function createReducer() {
+ return combineReducers({
+ currentGame: createCurrentGameReducer(),
+ currentUser: currentUserReducer,
+ games: createGamesReducer(),
+ routing: routerReducer,
+ });
+}
bgstack15