API Reference
useConvexConnectionState
Reference for the shared composable that reflects the realtime connection state.
useConvexConnectionState exposes the current Convex realtime connection state.
Import
Nuxt
const { state, isConnected } = useConvexConnectionState()
Vue
import { useConvexConnectionState } from 'vue-convex'
Signature
function useConvexConnectionState(): {
state: Readonly<Ref<ConnectionState | null>>
isConnected: ComputedRef<boolean>
}
Behavior
- Returns
nullwhen no realtime client is connected isConnectedmaps tostate.value?.isWebSocketConnected- Tracks connection changes after
connect(),reconfigure(), anddisconnect()