View as Markdown

API reference: @salmonui/data/json

createBatchingTransportfunction

import { createBatchingTransport } from '@salmonui/data/json';

Also exported from @salmonui/data.

function createBatchingTransport(send: (batch: WireBatchRequest, ctx: TransportContext) => Promise<WireBatchResponse>, options?: {
    readonly maxBatch?: number;
}): UniversalJsonTransport;

Multiplexes every request issued in the same tick into one { v: 1, batch: [...] } call (lazy group children, facets, prefetch). A consumer that aborts is rejected immediately; the shared call is aborted only when every consumer in it has aborted.