The createIdleAnyPromise
method takes an iterable of promises as input and returns a single Promise.
This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value.
It rejects when all of the input's promises reject (including when an empty iterable is passed), with an
AggregateError containing an array of rejection reasons.
A new Promise that is:
The
createIdleAnyPromise
method takes an array of promises as input and returns a single Promise. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an AggregateError containing an array of rejection reasons.Since
0.5.0
Param: values
An Array promises.
Param: timeout
Optional timeout to wait before processing the items, defaults to zero, only used when Native promises are not available.
Returns
A new Promise that is: