Anchorage API reference
    Preparing search index...

    A live connection the hook closes on unmount / transport change.

    interface StreamConnection {
        close(): void;
        send?(data: string): void;
    }
    Index

    Methods

    Methods

    • Send a frame to the server (optional). The hook uses it for a liveness heartbeat ('ping'); a transport that omits it simply gets no heartbeat and relies on the socket's own onClose. Browsers cannot send on a half-open socket, so the heartbeat + a pong deadline is what detects a silently dead connection and resumes polling (a broadcast-only run channel never fires onClose on its own).

      Parameters

      • data: string

      Returns void