diff options
author | jbion <joffrey.bion@amadeus.com> | 2019-02-27 03:12:55 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-02-27 03:12:55 +0100 |
commit | 8d73d21108738754efd07b63ecc7368fd49502fa (patch) | |
tree | 8755dd1aa9c61e9f473fd6787ba8f3595006f0fa /frontend/src/reducers.js | |
parent | Remove unnecessary Jackson annotation on non-DTOs (diff) | |
download | seven-wonders-8d73d21108738754efd07b63ecc7368fd49502fa.tar.gz seven-wonders-8d73d21108738754efd07b63ecc7368fd49502fa.tar.bz2 seven-wonders-8d73d21108738754efd07b63ecc7368fd49502fa.zip |
Simplify state and reducers
Diffstat (limited to 'frontend/src/reducers.js')
-rw-r--r-- | frontend/src/reducers.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/frontend/src/reducers.js b/frontend/src/reducers.js index 5e066d28..612bd0c5 100644 --- a/frontend/src/reducers.js +++ b/frontend/src/reducers.js @@ -1,15 +1,25 @@ // @flow import { routerReducer } from 'react-router-redux'; -import { combineReducers } from 'redux-immutable'; +import { combineReducers } from 'redux'; +import type { ApiPlayer } from './api/model'; +import type { CurrentGameState } from './redux/currentGame'; import { createCurrentGameReducer } from './redux/currentGame'; -import { gamesReducer } from './redux/games'; -import { playersReducer } from './redux/players'; +import type { GamesState } from './redux/games'; +import { createGamesReducer } from './redux/games'; +import { currentUserReducer } from './redux/user'; + +export type GlobalState = { + currentGame: CurrentGameState; + currentUser: ApiPlayer; + games: GamesState; + routing: any; +} export function createReducer() { return combineReducers({ currentGame: createCurrentGameReducer(), - games: gamesReducer, - players: playersReducer, + currentUser: currentUserReducer, + games: createGamesReducer(), routing: routerReducer, }); } |