This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk-vue / useRealtimeStatus

useRealtimeStatus() ​

useRealtimeStatus(): Readonly<Ref<RealtimeStatus>>

Status of the client's realtime connection ('connecting', 'open', 'reconnecting', 'closed' or 'unavailable'), reactive. It does not open the connection: it opens with the first useRealtime or useRealtimeSync. On the server (SSR) it is 'closed'.

Returns ​

Readonly<Ref<RealtimeStatus>>

Read-only ref with the current status.

Throws ​

If called in an app without the EnginexPlugin.

Example ​

ts
const status = useRealtimeStatus()
const reconnecting = computed(() => status.value === 'reconnecting')