@react-remote-state/client 2.0.0 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -5658,9 +5658,23 @@ function createInternalReducer(reducer, acceptPlayer) {
5658
5658
  return internalAction.game;
5659
5659
  case 0 /* Reduce */:
5660
5660
  if (!!game) {
5661
- internalAction.client.emit("update", {
5662
- game: reducer(game, internalAction.action, internalAction.playerId)
5663
- });
5661
+ let updatedGame = reducer(
5662
+ game,
5663
+ internalAction.action,
5664
+ internalAction.playerId
5665
+ );
5666
+ let playerCustoms = {};
5667
+ for (let player of updatedGame.players) {
5668
+ if (!!player.custom) {
5669
+ playerCustoms[player.id] = player.custom;
5670
+ }
5671
+ }
5672
+ let update = {
5673
+ gameId: game.id,
5674
+ gameCustom: updatedGame.custom,
5675
+ playerCustoms
5676
+ };
5677
+ internalAction.client.emit("update", update);
5664
5678
  }
5665
5679
  return game;
5666
5680
  case 2 /* Accept */: