Skip to main content

useStatus

Returns a promise that resolves when transport is connected. Resolves immediately if already connected.

moopsyClient.
transport.
useStatus
()
⚛ React Hook (Function)
()
Arguments
None
=>
Returns
Value of
TransportStatus (Enum)
"initializing" | "connecting" | "connected"

Usage

import { TransportStatus } from '@moopsyjs/react';

const status = moopsyClient.transport.useStatus();

if(status !== TransportStatus.connected) {
return <div>Connecting...</div>;
}