useSyncStatus
useSyncStatus(
options):SyncStatus
Defined in: react/src/useSyncStatus.ts:22
React hook that subscribes to sync status changes.
Returns the current synchronization status between the client session and the leader thread. The component re-renders whenever the sync status changes.
Parameters
Section titled “Parameters”options
Section titled “options”Options containing the store instance
Store<any>
Returns
Section titled “Returns”SyncStatus
The current sync status
Example
Section titled “Example”function SyncIndicator() { const status = store.useSyncStatus() return <span>{status.isSynced ? '✓ Synced' : `Syncing (${status.pendingCount} pending)...`}</span>}