Class LazyPromise<T>

LazyPromise, execute async operation when user await it.

Author

Theo Sun

Since

5.18.0

Type Parameters

  • T = any

Hierarchy

  • LazyPromise

Implements

  • Promise<T>

Constructors

Properties

Methods

Constructors

Properties

[toStringTag]: string

Methods

  • Type Parameters

    • TResult = never

    Parameters

    • Optional onrejected: ((reason) => TResult | PromiseLike<TResult>)
      Optional
        • (reason): TResult | PromiseLike<TResult>
        • Parameters

          • reason: any

          Returns TResult | PromiseLike<TResult>

    Returns Promise<T | TResult>

  • Parameters

    • Optional onfinally: (() => void)
      Optional
        • (): void
        • Returns void

    Returns Promise<T>

  • Type Parameters

    • TResult1 = T

    • TResult2 = never

    Parameters

    • Optional onfulfilled: ((value) => TResult1 | PromiseLike<TResult1>)
      Optional
        • (value): TResult1 | PromiseLike<TResult1>
        • Parameters

          • value: T

          Returns TResult1 | PromiseLike<TResult1>

    • Optional onrejected: ((reason) => TResult2 | PromiseLike<TResult2>)
      Optional
        • (reason): TResult2 | PromiseLike<TResult2>
        • Parameters

          • reason: any

          Returns TResult2 | PromiseLike<TResult2>

    Returns Promise<TResult1 | TResult2>