diff --git a/.changeset/tricky-gifts-compare.md b/.changeset/tricky-gifts-compare.md new file mode 100644 index 0000000000..c4737e7eae --- /dev/null +++ b/.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)}%); +} +```