Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ExtensiblePromise<T>

A safe to extend Promise, as its methods will not use the new class' constructor, but the one of the global Promise object.

Type parameters

  • T

Hierarchy

Implements

  • Promise<T>

Index

Constructors

Accessors

Methods

Constructors

constructor

Accessors

[toStringTag]

  • get [toStringTag](): string

Methods

catch

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

    • TF = never

    Parameters

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

    Returns 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