Interface SmoothStreamOptions<TState, TIncrement>

Type Parameters

  • TState

  • TIncrement

Hierarchy

  • SmoothStreamOptions

Properties

excessIncrementDurationMs?: number

The additional time to schedule for an increment to be streamed via subincrements. For example, if the expected time until the next poll() invocation returns is 700ms and this value is 200ms, the current increment will be streamed across 900ms. Defaults to 500ms.

finalIncrementDurationMs?: number

The time taken to stream the final increment. Defaults to 100ms.

minimumIncrementDurationMs?: number

The minimum time to wait between increments made available on the stream. Defaults to 17ms (60 fps).

pollIntervalMs?: number

The time to wait between each poll() invocation, in milliseconds. This time does not include the time taken to invoke poll(). Defaults to 1 second.

signal?: AbortSignal

The signal from an abort controller to stop the stream.

The time controller to use for detecting the duration of events during the stream.

Methods

  • The function to reassemble incremental states into a complete state.

    Parameters

    Returns TState

  • The function to subdivide an increment into smaller increments for a smoother stream. This function may return fewer than values than targetIncrements if that quantity of data is unavailable.

    Parameters

    Returns IncrementFraction<TIncrement>[]

  • The function to invoke to fetch the current state of data in the stream.

    Parameters

    • current: undefined | TState

    Returns Promise<{
        isDone: boolean;
        state: TState;
    }>

Generated using TypeDoc