Class Deferred<T>

Enables a Promise to be resolved or rejected at a future time, outside of the context of the Promise construction. Also exposes the pending, fulfilled, or rejected state of the promise.

Type Parameters

  • T

Hierarchy

  • Deferred

Implements

  • PromiseLike<T>

Constructors

Properties

[toStringTag]: "Deferred" = "Deferred"
promise: Promise<T>

Accessors

  • get fulfilled(): boolean
  • Returns

    true iff resolve has been invoked

    Returns boolean

  • get pending(): boolean
  • Returns

    true iff neither resolve nor rejected have been invoked

    Returns boolean

  • get rejected(): boolean
  • Returns

    true iff rejected has been invoked

    Returns boolean

  • get settled(): boolean
  • Returns

    true iff resolve or rejected have been invoked

    Returns boolean

Methods

  • Type Parameters

    • TResult = never

    Parameters

    • Optional onrejected: null | ((reason: any) => TResult | PromiseLike<TResult>)

    Returns Promise<T | TResult>

  • Parameters

    • Optional reason: string | Error

    Returns boolean

  • Parameters

    • value: T

    Returns boolean

  • Type Parameters

    • TResult1 = T

    • TResult2 = never

    Parameters

    • Optional onfulfilled: null | ((value: T) => TResult1 | PromiseLike<TResult1>)
    • Optional onrejected: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)

    Returns Promise<TResult1 | TResult2>

Generated using TypeDoc