• Creates a promise and a dependent cancellation token.

    The dependent cancellation token will be canceled if the specified cancellationToken is canceled while the promise is pending.

    Returns

    A new Promise.

    Type Parameters

    • T

    Parameters

    • cancellationToken: CancellationToken

      The token that provides notification of cancellation.

    • executor: ((resolve: ((value: T | Promise<T>) => void), reject: ((error: any) => void), token: CancellationToken) => void)

      The executor passed the resolve and reject functions for the promise, as well as the dependent cancellation token. If cancellation occurs after either resolve or reject is called, then the dependent token is not cancelled.

        • (resolve: ((value: T | Promise<T>) => void), reject: ((error: any) => void), token: CancellationToken): void
        • Parameters

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

                • value: T | Promise<T>

                Returns void

          • reject: ((error: any) => void)
              • (error: any): void
              • Parameters

                • error: any

                Returns void

          • token: CancellationToken

          Returns void

    Returns Promise<T>

Generated using TypeDoc