From 4081493b84ab5c78a5147d4af8d41fc2d9e027a5 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Fri, 29 Sep 2023 10:42:41 +0000 Subject: [PATCH] docs: changeset for indexer/store sync table IDs param (#1662) --- .changeset/nice-bikes-double.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .changeset/nice-bikes-double.md diff --git a/.changeset/nice-bikes-double.md b/.changeset/nice-bikes-double.md new file mode 100644 index 0000000000..c8f8997ec9 --- /dev/null +++ b/.changeset/nice-bikes-double.md @@ -0,0 +1,27 @@ +--- +"@latticexyz/store-indexer": minor +"@latticexyz/store-sync": minor +--- + +Added a `tableIds` parameter to store sync methods and indexer to allow filtering data streams by table IDs. Store sync methods automatically include all internal table IDs from Store and World. + +```ts +import { syncToRecs } from "@latticexyz/store-sync/recs"; +import { resourceIdToHex } from "@latticexyz/common"; + +syncToRecs({ + ... + tableIds: [resourceIdToHex(...)], +}); +``` + +```ts +import { createIndexerClient } from "@latticexyz/store-sync/trpc-indexer"; +import { resourceIdToHex } from "@latticexyz/common"; + +const client = createIndexerClient({ ... }); +client.findAll({ + ... + tableIds: [resourceIdToHex(...)], +}); +```