Typegres API Reference - v0.3.1
    Preparing search index...

    Type Alias LiveObserver<Rows>

    type LiveObserver<Rows> = {
        onNext: (rows: Rows) => unknown;
        onReturn?: () => unknown;
        onThrow?: (error: unknown) => unknown;
    }

    Type Parameters

    • Rows
    Index

    Properties

    onNext: (rows: Rows) => unknown

    Called with the full rowset on subscribe and after every committed mutation that changes it. The push is awaited before the next iteration runs: a slow consumer gets backpressure (intervening commits coalesce into the next rowset), and a dead one — e.g. a disconnected RPC peer — rejects, tearing the subscription down instead of leaking a watcher.

    onReturn?: () => unknown

    Called if the live stream ends without error (bus stopped).

    onThrow?: (error: unknown) => unknown