Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PromiseDelegate<T>

A class which wraps a promise into a delegate object.

Notes

This class is useful when the logic to resolve or reject a promise cannot be defined at the point where the promise is created.

Type parameters

  • T

Hierarchy

  • PromiseDelegate

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private _reject

_reject: function

Type declaration

    • (reason: any): void
    • Parameters

      • reason: any

      Returns void

Private _resolve

_resolve: function

Type declaration

    • (value: T | PromiseLike<T>): void
    • Parameters

      • value: T | PromiseLike<T>

      Returns void

promise

promise: Promise<T>

The promise wrapped by the delegate.

Methods

reject

  • reject(reason: any): void
  • Reject the wrapped promise with the given value.

    reason
    • The reason for rejecting the promise.

    Parameters

    • reason: any

    Returns void

resolve

  • resolve(value: T | PromiseLike<T>): void
  • Resolve the wrapped promise with the given value.

    Parameters

    • value: T | PromiseLike<T>

      The value to use for resolving the promise.

    Returns void

Generated using TypeDoc