Skip to content

Commit

Permalink
docs: add changeset for zustand sync progress (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Nov 13, 2023
1 parent 2b3c948 commit 7eabd06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .changeset/tricky-gifts-compare.md
@@ -0,0 +1,13 @@
---
"@latticexyz/store-sync": minor
---

Added and populated `syncProgress` key in Zustand store for sync progress, like we do for RECS sync. This will let apps using `syncToZustand` render a loading state while initial client hydration is in progress.

```tsx
const syncProgress = useStore((state) => state.syncProgress);

if (syncProgress.step !== SyncStep.LIVE) {
return <>Loading ({Math.floor(syncProgress.percentage)}%)</>;
}
```

0 comments on commit 7eabd06

Please sign in to comment.