API reference › @evolu/vue › useOwnerSyncStatus
Call Signature
function useOwnerSyncStatus(
syncState: ReadonlyStore<SyncState | null>,
): Readonly<Ref<OwnerSyncStatus>>;
Defined in: useOwnerSyncStatus.ts:40
Vue composable returning the OwnerSyncStatus of an owner in the
database of the provided Evolu instance, read from syncState, the
SyncStateDep.syncState store of the deps the instance was created
with. Without an owner, it is the status of Evolu.appOwner. Otherwise
pass the owner useOwner takes; a null owner, for a component that waits for
one, gives NoRelays. Like the other composables, it reads its arguments
once, so a component that shows another owner is keyed by that owner. Before
the first snapshot, during server rendering, and until a hydrating component
mounts, the status is NoRelays. Server rendering starts when the server
renderer does, so a call on the server before that, such as from a store that
a router guard uses first, follows the store as on the client.
A status keeps its object while it is unchanged, so the ref changes only when the status does. It stops following the store when the current effect scope, such as the component, is disposed. See OwnerSyncStatus for what to show.
Call Signature
function useOwnerSyncStatus(
syncState: ReadonlyStore<SyncState | null>,
owner: Owner | ReadonlyOwner | null,
): Readonly<Ref<OwnerSyncStatus>>;
Defined in: useOwnerSyncStatus.ts:44
For the owner useOwner takes, or null while there is none.