@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.mjs CHANGED
@@ -5647,9 +5647,23 @@ function createInternalReducer(reducer, acceptPlayer) {
5647
5647
  return internalAction.game;
5648
5648
  case 0 /* Reduce */:
5649
5649
  if (!!game) {
5650
- internalAction.client.emit("update", {
5651
- game: reducer(game, internalAction.action, internalAction.playerId)
5652
- });
5650
+ let updatedGame = reducer(
5651
+ game,
5652
+ internalAction.action,
5653
+ internalAction.playerId
5654
+ );
5655
+ let playerCustoms = {};
5656
+ for (let player of updatedGame.players) {
5657
+ if (!!player.custom) {
5658
+ playerCustoms[player.id] = player.custom;
5659
+ }
5660
+ }
5661
+ let update = {
5662
+ gameId: game.id,
5663
+ gameCustom: updatedGame.custom,
5664
+ playerCustoms
5665
+ };
5666
+ internalAction.client.emit("update", update);
5653
5667
  }
5654
5668
  return game;
5655
5669
  case 2 /* Accept */: