Function any

  • Creates a Promise that is fulfilled by the first given Promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. All the given promises can still independently fulfill after the first one, unlike with anyExclusive. Wraps Promise.all.

    Type Parameters

    • T extends [] | readonly unknown[]

    Parameters

    • createPromises: (() => T)

      A function that should return an array or iterable of Promises. The promises should be created inside this function.

        • (): T
        • Returns T

    Returns Promise<Awaited<T[number]>>

    A new Promise.

Generated using TypeDoc