Interface StreamJsonOptions<T>Beta

Options for streaming JSON line data from an API.

interface StreamJsonOptions<T> {
    body?: null | object | BodyInit;
    endpoint: string;
    jsonHandler: ((value: T) => Promise<void>);
}

Type Parameters

  • T

Hierarchy (view full)

Properties

body?: null | object | BodyInit

A BodyInit object, object or null to set request's body.

endpoint: string

The API endpoint to hit, starting with a slash.

jsonHandler: ((value: T) => Promise<void>)

The asynchronous function to process each JSON object.