@tsdotnet/promises - v2.0.11
    Preparing search index...

    Class PromiseBase<T>Abstract

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    • PromiseLike<T>
    Index

    Constructors

    Properties

    _error?: unknown
    _result?: T
    _state: State

    Accessors

    • get error(): unknown

      Returns unknown

    • 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.

      Parameters

      • milliseconds: number = 0

      Returns PromiseBase<T>

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

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

      Parameters

      • milliseconds: number = 0

      Returns PromiseBase<T>

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

    • .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, unknown>
      • OptionalonRejected: null | Reject<unknown>

      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, unknown>
      • OptionalonRejected: null | Reject<unknown>

      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.

      Parameters

      • fin: Closure
      • Optionalsynchronous: boolean

      Returns this

    • 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, unknown>
      • OptionalonRejected: null | Reject<unknown>

      Returns this