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

Implements

  • PromiseLike<T>

Constructors

Properties

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

Accessors

  • get fulfilled(): boolean
  • Returns boolean

    true iff resolve has been invoked

  • get pending(): boolean
  • Returns boolean

    true iff neither resolve nor rejected have been invoked

  • get rejected(): boolean
  • Returns boolean

    true iff rejected has been invoked

  • get settled(): boolean
  • Returns boolean

    true iff resolve or rejected have been invoked

Methods

  • Parameters

    • Optional reason: string | Error

    Returns boolean

  • Parameters

    • value: T

    Returns boolean