summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-07-25 00:40:12 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-07-25 00:40:12 +0200
commit43c4c1dd418295f36f97cac2225a5190a83e85de (patch)
tree7fa766205443a6f6d34d897d48dda4e04ce4a9f2 /frontend/src
parentFix message.body type using ternary (diff)
downloadseven-wonders-43c4c1dd418295f36f97cac2225a5190a83e85de.tar.gz
seven-wonders-43c4c1dd418295f36f97cac2225a5190a83e85de.tar.bz2
seven-wonders-43c4c1dd418295f36f97cac2225a5190a83e85de.zip
Fix Map unexepected constructor argument by removing new keyword
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/models/players.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/frontend/src/models/players.js b/frontend/src/models/players.js
index 5f7a4d70..8fb17128 100644
--- a/frontend/src/models/players.js
+++ b/frontend/src/models/players.js
@@ -25,19 +25,19 @@ export type PlayersShape = {
export type PlayersType = Record<PlayersShape>;
const PlayersRecord: PlayersType = Record({
- all: new Map(),
+ all: Map(),
current: '',
});
// $FlowFixMe
export default class PlayerState extends PlayersRecord {
addPlayer(p: PlayerShape) {
const player: Player = new Player(p);
- const playerMap = new Map(({ [player.username]: player }: { [key: string]: Player }));
+ const playerMap = Map({ [player.username]: player });
return this.addPlayers(playerMap).set('current', player.username);
}
addPlayers(p: Map<string, PlayerShape>) {
- const players: Map<string, PlayerShape> = new Map(p);
+ const players: Map<string, PlayerShape> = Map(p);
return this.mergeIn(['all'], players.map((player: PlayerShape): Player => new Player(player)));
}
}
bgstack15