data-cap
    Preparing search index...

    Interface SubscriptionEventHandlers<TEvent>

    Handlers a subscription's subscribe implementation drives -- the same shape coordinator.acquireSubscription already uses.

    interface SubscriptionEventHandlers<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; committed through processor into a writes-bounded fields patch.

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

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