Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeferredPromise<T>

brief

Externally control the resolution and rejection of a promise.

details

Creates a promise with accessible resolve and reject methods, enabling external entities to settle the promise based on custom logic or asynchronous events. This is particularly useful when the promise's outcome depends on factors outside the immediate context.

Type parameters

  • T

Hierarchy

  • DeferredPromise

Index

Constructors

Properties

Accessors

Constructors

constructor

Properties

Private mStatus

mStatus: DeferredPromiseStatus = DeferredPromiseStatus.Pending

promise

promise: Promise<T>

reject

reject: (reason?: any) => void

Type declaration

    • (reason?: any): void
    • Parameters

      • Optional reason: any

      Returns void

resolve

resolve: (value: T | PromiseLike<T>) => void

Type declaration

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

      • value: T | PromiseLike<T>

      Returns void

Accessors

status

Generated using TypeDoc