batch-cluster
    Preparing search index...

    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>
    Index

    Constructors

    Properties

    "[toStringTag]": "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

      • Optionalreason: string | Error

      Returns boolean

    • Attaches callbacks for the resolution and/or rejection of the Promise.

      Type Parameters

      • TResult1 = T
      • TResult2 = never

      Parameters

      • Optionalonfulfilled: null | ((value: T) => TResult1 | PromiseLike<TResult1>)

        The callback to execute when the Promise is resolved.

      • Optionalonrejected: null | ((reason: unknown) => TResult2 | PromiseLike<TResult2>)

        The callback to execute when the Promise is rejected.

      Returns Promise<TResult1 | TResult2>

      A Promise for the completion of which ever callback is executed.