Options
All
  • Public
  • Public/Protected
  • All
Menu

The Promise class.

Type parameters

  • T

Hierarchy

  • Promise

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Promise(singleton?: undefined | false | true): Promise
  • Parameters

    • Optional singleton: undefined | false | true

    Returns Promise

Properties

Readonly isSingleton

isSingleton: boolean

Readonly reject

reject: (result: any) => void

Rejects a promise.

Type declaration

    • (result: any): void
    • Parameters

      • result: any

      Returns void

Readonly resolve

resolve: (result: T) => void

Resolves a promise.

Type declaration

    • (result: T): void
    • Parameters

      • result: T

      Returns void

Readonly then

then: (success: (result: T) => void, failure?: undefined | ((result: any) => void)) => Promise<T>

Adds a success and failure handler for completion of this Promise object.

param

The success handler

param

The failure handler

returns

this

Type declaration

    • (success: (result: T) => void, failure?: undefined | ((result: any) => void)): Promise<T>
    • Parameters

      • success: (result: T) => void
          • (result: T): void
          • Parameters

            • result: T

            Returns void

      • Optional failure: undefined | ((result: any) => void)

      Returns Promise<T>

Methods

Static reject

  • reject<T>(reason: any): Promise<T>
  • Type parameters

    • T

    Parameters

    • reason: any

    Returns Promise<T>

Static resolve

  • Type parameters

    • T

    Parameters

    • value: T

    Returns Promise<T>