Skip to content

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.

Options containing the store instance

Store<any>

SyncStatus

The current sync status

function SyncIndicator() {
const status = store.useSyncStatus()
return <span>{status.isSynced ? '✓ Synced' : `Syncing (${status.pendingCount} pending)...`}</span>
}