Function any

  • Promise.any implementation

    just ref the MDN document

    Promise.any() takes an iterable of Promise objects and, as soon as one of the promises in the iterable fulfils, returns a single promise that resolves with the value from that promise. If no promises in the iterable fulfil (if all of the given promises are rejected), then throw the array of errors

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<Promise<T>>

    Returns Promise<T>

    Since

    5.7.0

    Throws

    Error list