An eventually loaded related model instance.

Type Parameters

  • T

Hierarchy

  • Promise<T>
    • AsyncItem

Constructors

  • Creates a new Promise.

    Type Parameters

    • T

    Parameters

    • executor: ((resolve, reject) => void)

      A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used to resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error.

        • (resolve, reject): void
        • Parameters

          • resolve: ((value) => void)
          • reject: ((reason?) => void)
              • (reason?): void
              • Parameters

                • Optional reason: any

                Returns void

          Returns void

    Returns AsyncItem<T>

Properties

[toStringTag]: string
[species]: PromiseConstructor

Methods

  • Attaches a callback for only the rejection of the Promise.

    Type Parameters

    • TResult = never

    Parameters

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

      The callback to execute when the Promise is rejected.

    Returns Promise<T | TResult>

    A Promise for the completion of the callback.

  • 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: null | (() => void)

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

    Returns Promise<T>

    A Promise for the completion of the callback.

  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type Parameters

    • TResult1 = T

    • TResult2 = never

    Parameters

    Returns Promise<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

    Type Parameters

    • T

    Parameters

    Returns Promise<Awaited<T>[]>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

    Type Parameters

    • T extends [] | readonly unknown[]

    Parameters

    • values: T

      An array of Promises.

    Returns Promise<{
        -readonly [P in string | number | symbol]: Awaited<T[P]>
    }>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

    Type Parameters

    • T extends [] | readonly unknown[]

    Parameters

    • values: T

      An array of Promises.

    Returns Promise<{
        -readonly [P in string | number | symbol]: PromiseSettledResult<Awaited<T[P]>>
    }>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

    Type Parameters

    • T

    Parameters

    Returns Promise<PromiseSettledResult<Awaited<T>>[]>

    A new Promise.

  • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

    Type Parameters

    • T

    Parameters

    Returns Promise<Awaited<T>>

    A new Promise.

  • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

    Type Parameters

    • T extends [] | readonly unknown[]

    Parameters

    • values: T

      An array of Promises.

    Returns Promise<Awaited<T[number]>>

    A new Promise.

  • Creates a new rejected promise for the provided reason.

    Type Parameters

    • T = never

    Parameters

    • Optional reason: any

      The reason the promise was rejected.

    Returns Promise<T>

    A new rejected Promise.

  • Creates a new resolved promise.

    Returns Promise<void>

    A resolved promise.

  • Creates a new resolved promise for the provided value.

    Type Parameters

    • T

    Parameters

    • value: T

      A promise.

    Returns Promise<Awaited<T>>

    A promise whose internal state matches the provided promise.

  • Creates a new resolved promise for the provided value.

    Type Parameters

    • T

    Parameters

    Returns Promise<Awaited<T>>

    A promise whose internal state matches the provided promise.