summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/redux/players.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/frontend/src/redux/players.js b/frontend/src/redux/players.js
index 85b5d042..09f7390b 100644
--- a/frontend/src/redux/players.js
+++ b/frontend/src/redux/players.js
@@ -1,4 +1,4 @@
-import {fromJS, Map, Set} from 'immutable'
+import { fromJS, Map } from 'immutable'
export const types = {
REQUEST_CHOOSE_USERNAME: 'USER/REQUEST_CHOOSE_USERNAME',
@@ -41,14 +41,10 @@ export default (state = initialState, action) => {
const getState = globalState => globalState.get('players')
-function keyIn(...keys) {
- return (v, k) => Set(keys).has(k)
-}
-
export const getAllPlayersByUsername = globalState => getState(globalState).get('all')
export const getAllPlayers = globalState => getAllPlayersByUsername(globalState).toList()
export const getPlayers = (globalState, usernames) => getAllPlayersByUsername(globalState)
- .filter(keyIn(usernames))
+ .filter((v, k) => usernames.contains(k))
.toList()
export const getCurrentPlayerUsername = globalState => getState(globalState).get('current')
export const getCurrentPlayer = globalState => getAllPlayersByUsername(globalState)
bgstack15