Interface LiveCallbacks

Callbacks for the live API.

interface LiveCallbacks {
    onclose?: null | (e: CloseEvent) => void;
    onerror?: null | (e: ErrorEvent) => void;
    onmessage: (e: LiveServerMessage) => void;
    onopen?: null | () => void;
}

Properties

onclose?: null | (e: CloseEvent) => void

Called when the websocket connection is closed.

onerror?: null | (e: ErrorEvent) => void

Called when an error occurs.

onmessage: (e: LiveServerMessage) => void

Called when a message is received from the server.

onopen?: null | () => void

Called when the websocket connection is established.