This promise class that facilitates pending resolution.

Type Parameters

  • T

Hierarchy

Constructors

Properties

_error?: any
_resolvedCalled: undefined | boolean
_result?: T
_state: State

Accessors

  • get error(): any
  • Returns any

  • get isFulfilled(): boolean
  • Returns boolean

  • get isPending(): boolean
  • Returns boolean

  • get isRejected(): boolean
  • Returns boolean

  • get isSettled(): boolean
  • Returns boolean

  • get result(): undefined | T
  • Returns undefined | T

Methods

  • Will yield for a number of milliseconds from after this promise resolves. If the promise is already resolved, the delay will start from now.

    Returns

    A promise that yields to the current execution and executes after a delay.

    Parameters

    • milliseconds: number = 0

    Returns PromiseBase<T>

  • Will yield for a number of milliseconds from the time called before continuing.

    Returns

    A promise that yields to the current execution and executes after a delay.

    Parameters

    • milliseconds: number = 0

    Returns PromiseBase<T>

  • .done is provided as a non-standard means that maps to similar functionality in other promise libraries. As stated by promisejs.org: 'then' is to 'done' as 'map' is to 'forEach'.

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, any>
    • Optional onRejected: null | Reject<any>

    Returns void

  • .doneNow is provided as a non-standard means that synchronously resolves as the end of a promise chain. As stated by promisejs.org: 'then' is to 'done' as 'map' is to 'forEach'. It is the underlying method by which propagation occurs.

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, any>
    • Optional onRejected: null | Reject<any>

    Returns void

  • Shortcut to for handling either resolve or reject. Returns the current promise instead. You may not need an additional promise result, and this will not create a new one.

    Returns

    Parameters

    • fin: Closure
    • Optional synchronous: boolean

    Returns TSDNPromise<T>

  • Parameters

    • error: unknown
    • throwIfSettled: boolean = false

    Returns void

  • Parameters

    • Optional result: T | PromiseLike<T>
    • throwIfSettled: boolean = false

    Returns void

  • Parameters

    • resolver: Executor<T>
    • forceSynchronous: boolean = false

    Returns void

  • Standard .then method that defers execution until resolved.

    Returns

    Type Parameters

    • TFulfilled = T

    • TRejected = never

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, TFulfilled>
    • Optional onRejected: null | Reject<TRejected>

    Returns PromiseBase<TFulfilled | TRejected>

  • Same as .then but doesn't trap errors. Exceptions may end up being fatal.

    Returns

    Type Parameters

    • TFulfilled = T

    • TRejected = never

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, TFulfilled>
    • Optional onRejected: null | Reject<TRejected>

    Returns PromiseBase<TFulfilled | TRejected>

  • Calls the respective handlers once the promise is resolved.

    Type Parameters

    • TFulfilled = T

    • TRejected = never

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, TFulfilled>
    • Optional onRejected: null | Reject<TRejected>

    Returns PromiseBase<TFulfilled | TRejected>

  • Same as 'thenSynchronous' but does not return the result. Returns the current promise instead. You may not need an additional promise result, and this will not create a new one.

    Parameters

    • onFulfilled: undefined | null | Fulfill<T, any>
    • Optional onRejected: null | Reject<any>

    Returns TSDNPromise<T>

Generated using TypeDoc