Interface PromiseTimeoutOptions<T>

Type Parameters

  • T

Hierarchy

  • PromiseTimeoutOptions

Properties

abortController?: AbortController

The abort controller to both listen for changes to abort early, and to invoke abort when timeout is reached.

abortErrorMessage?: string

The custom error message to use when the promise is aborted.

timeoutErrorMessage?: string

The custom error message to use when the timeout is reached.

timeoutMs: number

The elapsed time in milliseconds before the promise will reject. Values of infinity will return the original promise.

Methods

  • The function to invoke if the promise eventually rejects with a value.

    Parameters

    • error: Error

    Returns void

  • The function to invoke if the promise eventually resolves with a value.

    Parameters

    • value: T

    Returns void

Generated using TypeDoc