Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LazyPromise<T>

A promise that lets you wait until someone actually requests the result of the promise to kick off the action being promised. This lets you return the promise before you start executing the async action.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

Readonly [Symbol.toStringTag]

[Symbol.toStringTag]: string

Static Promise

Promise: PromiseConstructor

Methods

catch

  • catch<TResult>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>
  • Type parameters

    • TResult

    Parameters

    • Optional onrejected: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null

    Returns Promise<T | TResult>

finally

  • finally(onfinally?: (() => void) | undefined | null): Promise<T>
  • Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

    Parameters

    • Optional onfinally: (() => void) | undefined | null

      The callback to execute when the Promise is settled (fulfilled or rejected).

    Returns Promise<T>

    A Promise for the completion of the callback.

fulfill

  • fulfill(): void

then

  • then<TResult1, TResult2>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>
  • Type parameters

    • TResult1

    • TResult2

    Parameters

    • Optional onfulfilled: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null
    • Optional onrejected: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null

    Returns Promise<TResult1 | TResult2>

Generated using TypeDoc