Class AsyncProvider<T>

Async provider Allows a value to be provider asynchronously, with a timeout

Type Parameters

  • T = any

Hierarchy

  • AsyncProvider

Constructors

Properties

done: boolean
error?: Error
onReject?: RejectFunc
onResolve?: ResolveFunc<T>
promise: Promise<T>
timeout?: number | Timeout
timeoutMs: number
value?: T

Methods

  • Obtains the provided value (Async) May throw if the timeout is reached or an error is provided

    Returns

    A promise for the provided value

    Returns Promise<T>

  • Checks if the provider is done

    Returns

    True if the value or error was already provided

    Returns boolean

  • Provides an error

    Parameters

    • error: Error

      The error

    Returns void

  • Provides the value

    Parameters

    • value: T

      The value

    Returns void

  • Resets the provider, setting it to the same status it was after constructing it

    Returns void

  • Checks if an error is a timeout error

    Returns

    True if the error is a timeout error

    Parameters

    • e: Error

      The error

    Returns boolean

Generated using TypeDoc