Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CancellablePromise<T>

A cancellable Promise, taking a cancellation function returning executor. Cancellation can be triggered through the cancel method, or by an AbortSignal.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Accessors

[toStringTag]

  • get [toStringTag](): string

Methods

cancel

  • cancel(): void

catch

  • catch<TF>(onrejected?: null | UnaryFn<unknown, TF | PromiseLike<TF>>): Promise<T | TF>

finally

  • finally(onfinally?: null | NullaryFn<void>): Promise<T>

then

  • then<TS, TF>(onfulfilled?: null | UnaryFn<T, TS | PromiseLike<TS>>, onrejected?: null | UnaryFn<unknown, TF | PromiseLike<TF>>): Promise<TS | TF>
  • Type parameters

    • TS = T

    • TF = never

    Parameters

    • Optional onfulfilled: null | UnaryFn<T, TS | PromiseLike<TS>>
    • Optional onrejected: null | UnaryFn<unknown, TF | PromiseLike<TF>>

    Returns Promise<TS | TF>

Generated using TypeDoc