Skip to main content

useSyncStream()

function useSyncStream(name, options): {
status: ComputedRef<SyncStreamStatus>;
}

Creates a PowerSync stream subscription. The subscription is kept alive as long as the Vue component calling this function is mounted. When it unmounts, SyncStreamSubscription.unsubscribe is called

For more details on sync streams, see the documentation.

Parameters

ParameterType
nameMaybeRef<string>
optionsMaybeRef<UseSyncStreamOptions>

Returns

{
status: ComputedRef<SyncStreamStatus>;
}

A computed reference to the status for that stream, or null if the stream is currently being resolved.

NameType
statusComputedRef<SyncStreamStatus>