Subscribe to LiveStore synchronization status in a React component. Useful for connection indicators and offline-state handling.
useSyncStatus returns the current synchronization status between the local client session and the leader thread. The component re-renders whenever the status changes.
The store instance to subscribe to. Pass this explicitly when using the standalone hook from @livestore/react, or omit it when calling store.useSyncStatus() from a store returned by useStore.
useSyncStatus reads the initial status synchronously from store.syncStatus(), then subscribes via store.subscribeSyncStatus(). The component re-renders whenever the status object changes. The hook exposes a debug label LiveStore:useSyncStatus:synced or LiveStore:useSyncStatus:pending in React DevTools.
isSynced reflects synchronization between the client session and the leader thread, not between the leader thread and a remote sync backend. To check remote connectivity, use a separate network status indicator.