@react-remote-state/client 1.2.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 */: