@react-remote-state/client 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -76,10 +76,10 @@ function useRemoteReducer(uri, reducer, gameId) {
76
76
  (_b = meta.client) == null ? void 0 : _b.emit("join", { gameId });
77
77
  }
78
78
  });
79
+ meta.client.on("assign", (assign) => {
80
+ setMeta(__spreadProps(__spreadValues({}, meta), { localPlayerId: assign.playerId }));
81
+ });
79
82
  meta.client.on("update", (update) => {
80
- if (!meta.localPlayerId && !!update.playerId) {
81
- setMeta(__spreadProps(__spreadValues({}, meta), { localPlayerId: update.playerId }));
82
- }
83
83
  setGame(update.game);
84
84
  });
85
85
  } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Game } from \"@react-remote-state/types\";\nimport { useEffect, useState } from \"react\";\nimport { connect, Socket as Client } from \"socket.io-client\";\n\ntype Meta = {\n client?: Client;\n isHostReady: boolean;\n localPlayerId?: string;\n};\n\nexport function getPlayer<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n if (!game || !playerId) {\n return undefined;\n }\n\n return game.players.find((player) => player.id == playerId);\n}\n\nexport function isHost<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n let player = getPlayer(playerId, game);\n\n return player?.host;\n}\n\ntype Reducer<GameCustom, PlayerCustom, Action> = (\n game: Game<GameCustom, PlayerCustom>,\n action: Action,\n playerId: string\n) => Game<GameCustom, PlayerCustom>;\n\nexport function useRemoteReducer<GameCustom, PlayerCustom, Action>(\n uri: string,\n reducer: Reducer<GameCustom, PlayerCustom, Action>,\n gameId?: string\n): [\n Game<GameCustom, PlayerCustom> | undefined,\n string | undefined,\n (action: Action) => void\n] {\n let [meta, setMeta] = useState<Meta>({\n isHostReady: false,\n });\n\n let [game, setGame] = useState<Game<GameCustom, PlayerCustom>>();\n\n let dispatch = (action: Action) => {\n if (!!meta.client && !!game) {\n meta.client.emit(\"notify\", { gameId: game.id, action });\n }\n };\n\n useEffect(() => {\n if (!meta.client) {\n meta.client = connect(uri);\n meta.client.on(\"error\", console.error);\n meta.client.on(\"connect\", () => {\n if (gameId == undefined) {\n meta.client?.emit(\"create\");\n } else {\n meta.client?.emit(\"join\", { gameId });\n }\n });\n\n meta.client.on(\"update\", (update) => {\n if (!meta.localPlayerId && !!update.playerId) {\n setMeta({ ...meta, localPlayerId: update.playerId });\n }\n\n setGame(update.game);\n });\n } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {\n meta.client.on(\"join\", (join) => {\n meta.client?.emit(\"accept\", {\n gameId: game?.id,\n playerId: join.playerId,\n });\n });\n\n meta.client.on(\"notify\", (notify) => {\n if (!!game) {\n meta.client?.emit(\"update\", {\n game: reducer(game, notify.action, notify.playerId),\n });\n }\n });\n\n setMeta({ ...meta, isHostReady: true });\n }\n });\n\n return [game, meta.localPlayerId, dispatch];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAoC;AACpC,oBAA0C;AAQnC,SAAS,UACd,UACA,MACA;AACA,MAAI,CAAC,QAAQ,CAAC,UAAU;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,QAAQ,KAAK,CAAC,WAAW,OAAO,MAAM,QAAQ;AAC5D;AAEO,SAAS,OACd,UACA,MACA;AACA,MAAI,SAAS,UAAU,UAAU,IAAI;AAErC,SAAO,iCAAQ;AACjB;AAQO,SAAS,iBACd,KACA,SACA,QAKA;AACA,MAAI,CAAC,MAAM,OAAO,QAAI,uBAAe;AAAA,IACnC,aAAa;AAAA,EACf,CAAC;AAED,MAAI,CAAC,MAAM,OAAO,QAAI,uBAAyC;AAE/D,MAAI,WAAW,CAAC,WAAmB;AACjC,QAAI,CAAC,CAAC,KAAK,UAAU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names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Game } from \"@react-remote-state/types\";\nimport { useEffect, useState } from \"react\";\nimport { connect, Socket as Client } from \"socket.io-client\";\n\ntype Meta = {\n client?: Client;\n isHostReady: boolean;\n localPlayerId?: string;\n};\n\nexport function getPlayer<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n if (!game || !playerId) {\n return undefined;\n }\n\n return game.players.find((player) => player.id == playerId);\n}\n\nexport function isHost<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n let player = getPlayer(playerId, game);\n\n return player?.host;\n}\n\ntype Reducer<GameCustom, PlayerCustom, Action> = (\n game: Game<GameCustom, PlayerCustom>,\n action: Action,\n playerId: string\n) => Game<GameCustom, PlayerCustom>;\n\nexport function useRemoteReducer<GameCustom, PlayerCustom, Action>(\n uri: string,\n reducer: Reducer<GameCustom, PlayerCustom, Action>,\n gameId?: string\n): [\n Game<GameCustom, PlayerCustom> | undefined,\n string | undefined,\n (action: Action) => void\n] {\n let [meta, setMeta] = useState<Meta>({\n isHostReady: false,\n });\n\n let [game, setGame] = useState<Game<GameCustom, PlayerCustom>>();\n\n let dispatch = (action: Action) => {\n if (!!meta.client && !!game) {\n meta.client.emit(\"notify\", { gameId: game.id, action });\n }\n };\n\n useEffect(() => {\n if (!meta.client) {\n meta.client = connect(uri);\n meta.client.on(\"error\", console.error);\n meta.client.on(\"connect\", () => {\n if (gameId == undefined) {\n meta.client?.emit(\"create\");\n } else {\n meta.client?.emit(\"join\", { gameId });\n }\n });\n\n meta.client.on(\"assign\", (assign) => {\n setMeta({ ...meta, localPlayerId: assign.playerId });\n });\n\n meta.client.on(\"update\", (update) => {\n setGame(update.game);\n });\n } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {\n meta.client.on(\"join\", (join) => {\n meta.client?.emit(\"accept\", {\n gameId: game?.id,\n playerId: join.playerId,\n });\n });\n\n meta.client.on(\"notify\", (notify) => {\n if (!!game) {\n meta.client?.emit(\"update\", {\n game: reducer(game, notify.action, notify.playerId),\n });\n }\n });\n\n setMeta({ ...meta, isHostReady: true });\n }\n });\n\n return [game, meta.localPlayerId, dispatch];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAoC;AACpC,oBAA0C;AAQnC,SAAS,UACd,UACA,MACA;AACA,MAAI,CAAC,QAAQ,CAAC,UAAU;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,QAAQ,KAAK,CAAC,WAAW,OAAO,MAAM,QAAQ;AAC5D;AAEO,SAAS,OACd,UACA,MACA;AACA,MAAI,SAAS,UAAU,UAAU,IAAI;AAErC,SAAO,iCAAQ;AACjB;AAQO,SAAS,iBACd,KACA,SACA,QAKA;AACA,MAAI,CAAC,MAAM,OAAO,QAAI,uBAAe;AAAA,IACnC,aAAa;AAAA,EACf,CAAC;AAED,MAAI,CAAC,MAAM,OAAO,QAAI,uBAAyC;AAE/D,MAAI,WAAW,CAAC,WAAmB;AACjC,QAAI,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,MAAM;AAC3B,WAAK,OAAO,KAAK,UAAU,EAAE,QAAQ,KAAK,IAAI,OAAO,CAAC;AAAA,IACxD;AAAA,EACF;AAEA,8BAAU,MAAM;AACd,QAAI,CAAC,KAAK,QAAQ;AAChB,WAAK,aAAS,uBAAQ,GAAG;AACzB,WAAK,OAAO,GAAG,SAAS,QAAQ,KAAK;AACrC,WAAK,OAAO,GAAG,WAAW,MAAM;AA7DtC;AA8DQ,YAAI,UAAU,QAAW;AACvB,qBAAK,WAAL,mBAAa,KAAK;AAAA,QACpB,OAAO;AACL,qBAAK,WAAL,mBAAa,KAAK,QAAQ,EAAE,OAAO;AAAA,QACrC;AAAA,MACF,CAAC;AAED,WAAK,OAAO,GAAG,UAAU,CAAC,WAAW;AACnC,gBAAQ,iCAAK,OAAL,EAAW,eAAe,OAAO,SAAS,EAAC;AAAA,MACrD,CAAC;AAED,WAAK,OAAO,GAAG,UAAU,CAAC,WAAW;AACnC,gBAAQ,OAAO,IAAI;AAAA,MACrB,CAAC;AAAA,IACH,WAAW,OAAO,KAAK,eAAe,IAAI,KAAK,CAAC,KAAK,aAAa;AAChE,WAAK,OAAO,GAAG,QAAQ,CAAC,SAAS;AA7EvC;AA8EQ,mBAAK,WAAL,mBAAa,KAAK,UAAU;AAAA,UAC1B,QAAQ,6BAAM;AAAA,UACd,UAAU,KAAK;AAAA,QACjB;AAAA,MACF,CAAC;AAED,WAAK,OAAO,GAAG,UAAU,CAAC,WAAW;AApF3C;AAqFQ,YAAI,CAAC,CAAC,MAAM;AACV,qBAAK,WAAL,mBAAa,KAAK,UAAU;AAAA,YAC1B,MAAM,QAAQ,MAAM,OAAO,QAAQ,OAAO,QAAQ;AAAA,UACpD;AAAA,QACF;AAAA,MACF,CAAC;AAED,cAAQ,iCAAK,OAAL,EAAW,aAAa,KAAK,EAAC;AAAA,IACxC;AAAA,EACF,CAAC;AAED,SAAO,CAAC,MAAM,KAAK,eAAe,QAAQ;AAC5C;","names":[]}
package/dist/index.mjs CHANGED
@@ -53,10 +53,10 @@ function useRemoteReducer(uri, reducer, gameId) {
53
53
  (_b = meta.client) == null ? void 0 : _b.emit("join", { gameId });
54
54
  }
55
55
  });
56
+ meta.client.on("assign", (assign) => {
57
+ setMeta(__spreadProps(__spreadValues({}, meta), { localPlayerId: assign.playerId }));
58
+ });
56
59
  meta.client.on("update", (update) => {
57
- if (!meta.localPlayerId && !!update.playerId) {
58
- setMeta(__spreadProps(__spreadValues({}, meta), { localPlayerId: update.playerId }));
59
- }
60
60
  setGame(update.game);
61
61
  });
62
62
  } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Game } from \"@react-remote-state/types\";\nimport { useEffect, useState } from \"react\";\nimport { connect, Socket as Client } from \"socket.io-client\";\n\ntype Meta = {\n client?: Client;\n isHostReady: boolean;\n localPlayerId?: string;\n};\n\nexport function getPlayer<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n if (!game || !playerId) {\n return undefined;\n }\n\n return game.players.find((player) => player.id == playerId);\n}\n\nexport function isHost<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n let player = getPlayer(playerId, game);\n\n return player?.host;\n}\n\ntype Reducer<GameCustom, PlayerCustom, Action> = (\n game: Game<GameCustom, PlayerCustom>,\n action: Action,\n playerId: string\n) => Game<GameCustom, PlayerCustom>;\n\nexport function useRemoteReducer<GameCustom, PlayerCustom, Action>(\n uri: string,\n reducer: Reducer<GameCustom, PlayerCustom, Action>,\n gameId?: string\n): [\n Game<GameCustom, PlayerCustom> | undefined,\n string | undefined,\n (action: Action) => void\n] {\n let [meta, setMeta] = useState<Meta>({\n isHostReady: false,\n });\n\n let [game, setGame] = useState<Game<GameCustom, PlayerCustom>>();\n\n let dispatch = (action: Action) => {\n if (!!meta.client && !!game) {\n meta.client.emit(\"notify\", { gameId: game.id, action });\n }\n };\n\n useEffect(() => {\n if (!meta.client) {\n meta.client = connect(uri);\n meta.client.on(\"error\", console.error);\n meta.client.on(\"connect\", () => {\n if (gameId == undefined) {\n meta.client?.emit(\"create\");\n } else {\n meta.client?.emit(\"join\", { gameId });\n }\n });\n\n meta.client.on(\"update\", (update) => {\n if (!meta.localPlayerId && !!update.playerId) {\n setMeta({ ...meta, localPlayerId: update.playerId });\n }\n\n setGame(update.game);\n });\n } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {\n meta.client.on(\"join\", (join) => {\n meta.client?.emit(\"accept\", {\n gameId: game?.id,\n playerId: join.playerId,\n });\n });\n\n meta.client.on(\"notify\", (notify) => {\n if (!!game) {\n meta.client?.emit(\"update\", {\n game: reducer(game, notify.action, not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AEA,gBAAQ,OAAO,IAAI;AAAA,MACrB,CAAC;AAAA,IACH,WAAW,OAAO,KAAK,eAAe,IAAI,KAAK,CAAC,KAAK,aAAa;AAChE,WAAK,OAAO,GAAG,QAAQ,CAAC,SAAS;AA7EvC;AA8EQ,mBAAK,WAAL,mBAAa,KAAK,UAAU;AAAA,UAC1B,QAAQ,6BAAM;AAAA,UACd,UAAU,KAAK;AAAA,QACjB;AAAA,MACF,CAAC;AAED,WAAK,OAAO,GAAG,UAAU,CAAC,WAAW;AApF3C;AAqFQ,YAAI,CAAC,CAAC,MAAM;AACV,qBAAK,WAAL,mBAAa,KAAK,UAAU;AAAA,YAC1B,MAAM,QAAQ,MAAM,OAAO,QAAQ,OAAO,QAAQ;AAAA,UACpD;AAAA,QACF;AAAA,MACF,CAAC;AAED,cAAQ,iCAAK,OAAL,EAAW,aAAa,KAAK,EAAC;AAAA,IACxC;AAAA,EACF,CAAC;AAED,SAAO,CAAC,MAAM,KAAK,eAAe,QAAQ;AAC5C;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Game } from \"@react-remote-state/types\";\nimport { useEffect, useState } from \"react\";\nimport { connect, Socket as Client } from \"socket.io-client\";\n\ntype Meta = {\n client?: Client;\n isHostReady: boolean;\n localPlayerId?: string;\n};\n\nexport function getPlayer<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n if (!game || !playerId) {\n return undefined;\n }\n\n return game.players.find((player) => player.id == playerId);\n}\n\nexport function isHost<GameCustom, PlayerCustom>(\n playerId?: string,\n game?: Game<GameCustom, PlayerCustom>\n) {\n let player = getPlayer(playerId, game);\n\n return player?.host;\n}\n\ntype Reducer<GameCustom, PlayerCustom, Action> = (\n game: Game<GameCustom, PlayerCustom>,\n action: Action,\n playerId: string\n) => Game<GameCustom, PlayerCustom>;\n\nexport function useRemoteReducer<GameCustom, PlayerCustom, Action>(\n uri: string,\n reducer: Reducer<GameCustom, PlayerCustom, Action>,\n gameId?: string\n): [\n Game<GameCustom, PlayerCustom> | undefined,\n string | undefined,\n (action: Action) => void\n] {\n let [meta, setMeta] = useState<Meta>({\n isHostReady: false,\n });\n\n let [game, setGame] = useState<Game<GameCustom, PlayerCustom>>();\n\n let dispatch = (action: Action) => {\n if (!!meta.client && !!game) {\n meta.client.emit(\"notify\", { gameId: game.id, action });\n }\n };\n\n useEffect(() => {\n if (!meta.client) {\n meta.client = connect(uri);\n meta.client.on(\"error\", console.error);\n meta.client.on(\"connect\", () => {\n if (gameId == undefined) {\n meta.client?.emit(\"create\");\n } else {\n meta.client?.emit(\"join\", { gameId });\n }\n });\n\n meta.client.on(\"assign\", (assign) => {\n setMeta({ ...meta, localPlayerId: assign.playerId });\n });\n\n meta.client.on(\"update\", (update) => {\n setGame(update.game);\n });\n } else if (isHost(meta.localPlayerId, game) && !meta.isHostReady) {\n meta.client.on(\"join\", (join) => {\n meta.client?.emit(\"accept\", {\n gameId: game?.id,\n playerId: join.playerId,\n });\n });\n\n meta.client.on(\"notify\", (notify) => {\n if (!!game) {\n meta.client?.emit(\"update\", {\n game: reducer(game, notify.action, notify.playerId),\n });\n }\n });\n\n setMeta({ ...meta, isHostReady: true });\n }\n });\n\n return [game, meta.localPlayerId, dispatch];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,SAAS,WAAW,gBAAgB;AACpC,SAAS,eAAiC;AAQnC,SAAS,UACd,UACA,MACA;AACA,MAAI,CAAC,QAAQ,CAAC,UAAU;AACtB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,QAAQ,KAAK,CAAC,WAAW,OAAO,MAAM,QAAQ;AAC5D;AAEO,SAAS,OACd,UACA,MACA;AACA,MAAI,SAAS,UAAU,UAAU,IAAI;AAErC,SAAO,iCAAQ;AACjB;AAQO,SAAS,iBACd,KACA,SACA,QAKA;AACA,MAAI,CAAC,MAAM,OAAO,IAAI,SAAe;AAAA,IACnC,aAAa;AAAA,EACf,CAAC;AAED,MAAI,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EAAC;AAAA,IACxC;AAAA,EACF,CAAC;AAED,SAAO,CAAC,MAAM,KAAK,eAAe,QAAQ;AAC5C;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-remote-state/client",
3
- "version": "0.0.2",
3
+ "version": "1.0.0",
4
4
  "description": "Client for React Remote State applications",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -15,7 +15,7 @@
15
15
  "author": "",
16
16
  "license": "ISC",
17
17
  "devDependencies": {
18
- "@react-remote-state/server": "^0.0.1",
18
+ "@react-remote-state/server": "^1.0.0",
19
19
  "@sheerun/mutationobserver-shim": "^0.3.3",
20
20
  "@testing-library/react": "^16.0.1",
21
21
  "@types/lodash": "^4.17.12",
@@ -31,7 +31,7 @@
31
31
  "react": "^18.3.1"
32
32
  },
33
33
  "dependencies": {
34
- "@react-remote-state/types": "^0.0.1",
34
+ "@react-remote-state/types": "^1.0.0",
35
35
  "socket.io-client": "^4.8.1"
36
36
  }
37
37
  }