Interface: SyncStatus
このコンテンツはまだ日本語訳がありません。
Interface: SyncStatus
Section titled “Interface: SyncStatus”Defined in: react/src/use-sync-status.ts:12
Snapshot of the client’s sync state, polled at refreshIntervalMs.
All fields update reactively so consumers can render “offline” /
“N unsaved changes” / “last synced 5s ago” without wiring their
own polling.
Properties
Section titled “Properties”online
Section titled “online”
readonlyonline:boolean
Defined in: react/src/use-sync-status.ts:17
true while the browser is online. Follows navigator.onLine
via online / offline events. Read directly on first render.
outboxDepth
Section titled “outboxDepth”
readonlyoutboxDepth:number
Defined in: react/src/use-sync-status.ts:23
The number of un-confirmed mutations in the outbox — writes that
happened locally but haven’t been acknowledged by the server.
0 means everything you’ve done is durable on the server.
lastError
Section titled “lastError”
readonlylastError:SyncClientError|null
Defined in: react/src/use-sync-status.ts:29
Most recent SyncClientError observed since the hook mounted.
null when there’s been no error, or after a successful push /
pull has cleared the transient network state.
syncing
Section titled “syncing”
readonlysyncing:boolean
Defined in: react/src/use-sync-status.ts:34
true while the client believes it’s mid-sync (a poll or manual
push/pull is in flight). Useful for a subtle spinner.