SyncStatus
SyncStatus =
object
Defined in: packages/@livestore/livestore/src/store/store-types.ts:437
Represents the current synchronization status of the store.
This provides visibility into the sync state between the client session and the leader thread, allowing applications to show sync indicators or determine backend health.
Example
Section titled “Example”const status = store.syncStatus()if (status.isSynced) { console.log('All changes synced')} else { console.log(`${status.pendingCount} events pending sync`)}Properties
Section titled “Properties”isSynced
Section titled “isSynced”isSynced:
boolean
Defined in: packages/@livestore/livestore/src/store/store-types.ts:456
Whether the client session is fully synced with the leader thread. True when there are no pending events (pendingCount === 0).
localHead
Section titled “localHead”localHead:
string
Defined in: packages/@livestore/livestore/src/store/store-types.ts:442
The local head sequence number (most recent event in the client session). Represented as a string in the format “e{global}.{client}” (e.g., “e5.2”).
pendingCount
Section titled “pendingCount”pendingCount:
number
Defined in: packages/@livestore/livestore/src/store/store-types.ts:451
Number of events pending synchronization to the leader thread.
upstreamHead
Section titled “upstreamHead”upstreamHead:
string
Defined in: packages/@livestore/livestore/src/store/store-types.ts:447
The upstream head sequence number (what the leader thread has confirmed). Represented as a string in the format “e{global}” (e.g., “e3”).