From 43c4c1dd418295f36f97cac2225a5190a83e85de Mon Sep 17 00:00:00 2001 From: Victor Chabbert Date: Tue, 25 Jul 2017 00:40:12 +0200 Subject: Fix Map unexepected constructor argument by removing new keyword --- frontend/src/models/players.js | 6 +++--- 1 file 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; 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) { - const players: Map = new Map(p); + const players: Map = Map(p); return this.mergeIn(['all'], players.map((player: PlayerShape): Player => new Player(player))); } } -- cgit