-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: changeset for indexer/store sync table IDs param (#1662)
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(...)], | ||
}); | ||
``` |