Class CancellablePromise

a cancellable promise a Promise with a cancel function, which can be cancellend any time this is useful for promises which use cancellable asynchronous operations note, even in a cancel state, the finally of the promise is executed, however subsequent thens are not anymore. The current then however is fished or a catch is called depending on how the outer operation reacts to a cancel order.

Hierarchy

  • Promise
    • CancellablePromise

Constructors

Properties

Methods

Constructors

  • Parameters

    • executor: ((resolve: ((val?: any) => void), reject: ((val?: any) => void)) => void)

      asynchronous callback operation which triggers the callback

        • (resolve: ((val?: any) => void), reject: ((val?: any) => void)): void
        • Parameters

          • resolve: ((val?: any) => void)
              • (val?: any): void
              • Parameters

                • Optional val: any

                Returns void

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

                • Optional val: any

                Returns void

          Returns void

    • cancellator: (() => void)

      cancel operation, separate from the trigger operation

        • (): void
        • Returns void

    Returns CancellablePromise

Properties

status: PromiseStatus = PromiseStatus.PENDING

Methods

  • Parameters

    • executorFunc: ((val?: any) => any)
        • (val?: any): any
        • Parameters

          • Optional val: any

          Returns any

    • Optional catchfunc: ((val?: any) => any)
        • (val?: any): any
        • Parameters

          • Optional val: any

          Returns any

    Returns CancellablePromise

  • Parameters

    • reason: any

    Returns Promise

  • Parameters

    • reason: any

    Returns Promise

Generated using TypeDoc