data-cap
    Preparing search index...

    Interface SubscriptionHandlers<TEvent>

    Handlers a coordinator-managed subscription drives -- see SubscriptionEventHandlers, the same shape without a bound params.

    interface SubscriptionHandlers<TEvent> {
        onEvent: (event: TEvent) => void;
        onStatusChange: (
            status:
                | "error"
                | "connecting"
                | "connected"
                | "reconnecting"
                | "disconnected",
            detail?: { error?: unknown },
        ) => void;
    }

    Type Parameters

    • TEvent
    Index
    onEvent: (event: TEvent) => void

    Call with each incoming event.

    onStatusChange: (
        status:
            | "error"
            | "connecting"
            | "connected"
            | "reconnecting"
            | "disconnected",
        detail?: { error?: unknown },
    ) => void

    Call whenever the subscription's connection status changes, optionally with the triggering error.