diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-21 20:20:45 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-22 00:23:02 +0200 |
commit | c03e68041e0f444e18a895058afbdf0d68759517 (patch) | |
tree | 6e31f9726d36e746f43c7856cebff8c861577e31 /frontend/src/redux/players.js | |
parent | Clean name in websocket.js (diff) | |
download | seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.gz seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.bz2 seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.zip |
Update prettier config and reformat
Here's the discussion summary:
- single quote, because that's what I'm used to in the JS world
- trailing comma, to avoid unnecessary git changes
- print-width 120, because 120 still doesn't require to scroll horizontally, and vertical space is precious
Diffstat (limited to 'frontend/src/redux/players.js')
-rw-r--r-- | frontend/src/redux/players.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/frontend/src/redux/players.js b/frontend/src/redux/players.js index 4016076f..b11e920f 100644 --- a/frontend/src/redux/players.js +++ b/frontend/src/redux/players.js @@ -1,37 +1,37 @@ -import Immutable from "seamless-immutable"; +import Immutable from 'seamless-immutable'; export const types = { - REQUEST_CHOOSE_USERNAME: "USER/REQUEST_CHOOSE_USERNAME", - SET_CURRENT_PLAYER: "USER/SET_CURRENT_PLAYER", - UPDATE_PLAYERS: "USER/UPDATE_PLAYERS" + REQUEST_CHOOSE_USERNAME: 'USER/REQUEST_CHOOSE_USERNAME', + SET_CURRENT_PLAYER: 'USER/SET_CURRENT_PLAYER', + UPDATE_PLAYERS: 'USER/UPDATE_PLAYERS', }; export const actions = { chooseUsername: username => ({ type: types.REQUEST_CHOOSE_USERNAME, - username + username, }), setCurrentPlayer: player => ({ type: types.SET_CURRENT_PLAYER, - player + player, }), updatePlayers: players => ({ type: types.UPDATE_PLAYERS, - players - }) + players, + }), }; const initialState = Immutable.from({ all: {}, - current: "" + current: '', }); export default (state = initialState, action) => { switch (action.type) { case types.SET_CURRENT_PLAYER: const player = action.player; - const withNewPlayer = state.setIn(["all", player.username], player); - return Immutable.set(withNewPlayer, "current", player.username); + const withNewPlayer = state.setIn(['all', player.username], player); + return Immutable.set(withNewPlayer, 'current', player.username); case types.UPDATE_PLAYERS: return Immutable.merge(state, { all: action.players }, { deep: true }); default: @@ -39,8 +39,6 @@ export default (state = initialState, action) => { } }; -export const getCurrentPlayer = state => - state.players.all && state.players.all[state.players.current]; +export const getCurrentPlayer = state => state.players.all && state.players.all[state.players.current]; export const getPlayer = (state, username) => state.players.all[username]; -export const getPlayers = (state, usernames) => - usernames.map(u => getPlayer(state, u)); +export const getPlayers = (state, usernames) => usernames.map(u => getPlayer(state, u)); |