Class CancelablePromise<T>

Type Parameters

  • T

Hierarchy

  • CancelablePromise

Implements

  • Promise<T>

Constructors

  • Type Parameters

    • T

    Parameters

    • executor: ((resolve: ((value: T | PromiseLike<T>) => void), reject: ((reason?: any) => void), onCancel: OnCancel) => void)
        • (resolve: ((value: T | PromiseLike<T>) => void), reject: ((reason?: any) => void), onCancel: OnCancel): void
        • Parameters

          • resolve: ((value: T | PromiseLike<T>) => void)
              • (value: T | PromiseLike<T>): void
              • Parameters

                • value: T | PromiseLike<T>

                Returns void

          • reject: ((reason?: any) => void)
              • (reason?: any): void
              • Parameters

                • Optional reason: any

                Returns void

          • onCancel: OnCancel

          Returns void

    Returns CancelablePromise<T>

Properties

[toStringTag]: string
_cancelHandlers: (() => void)[]
_isCancelled: boolean
_isRejected: boolean
_isResolved: boolean
_promise: Promise<T>
_reject?: ((reason?: any) => void)

Type declaration

    • (reason?: any): void
    • Parameters

      • Optional reason: any

      Returns void

_resolve?: ((value: T | PromiseLike<T>) => void)

Type declaration

    • (value: T | PromiseLike<T>): void
    • Parameters

      • value: T | PromiseLike<T>

      Returns void

Accessors

Methods

  • Type Parameters

    • TResult = never

    Parameters

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

    Returns Promise<T | TResult>

  • 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