Options
All
  • Public
  • Public/Protected
  • All
Menu

Resolves or rejects a PromiseLike from outside of it.

This class is significantly different from PromiseResolutionSource in the way that it ensures when tryResolve, tryCancel, or tryReject is called, the continuation callbacks associated with PromiseLike are executed synchronously. However, downstream consumers are still able to let their continuation callbacks execute asynchronously. See IConfigurablePromiseLike for more information.

This class is similar to Deferred but it explicitly separates the promise and its control side into two different objects.

Type parameters

  • T

    type of the promise resolution result.

Hierarchy

  • PromiseLikeResolutionSource

Index

Accessors

promiseLike

Methods

tryCancel

  • tryCancel(): boolean

tryReject

  • tryReject(reason: any): boolean

tryResolve

  • tryResolve(result: T | PromiseLike<T>): boolean
  • Synchronously resolves the derived PromiseLike with the specified result.

    Parameters

    • result: T | PromiseLike<T>

      the resolution result, or a PromiseLike that can be further resolved.

    Returns boolean

    true if the derived PromiseLike has just been resolved; otherwise it means the PromiseLike has already been settled before.

Generated using TypeDoc