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:
Already rejected, if the iterable passed is empty.
Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value
is the fulfillment value of the first promise that was fulfilled.
Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is
an AggregateError containing an array of rejection reasons in its errors property. The errors are in the
order of the promises passed, regardless of completion order. If the iterable passed is non-empty but
contains no pending promises, the returned promise is still asynchronously (instead of synchronously)
rejected.
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.
Already rejected, if the iterable passed is empty.
Asynchronously fulfilled, when any of the promises in the given iterable fulfills. The fulfillment value
is the fulfillment value of the first promise that was fulfilled.
Asynchronously rejected, when all of the promises in the given iterable reject. The rejection reason is
an AggregateError containing an array of rejection reasons in its errors property. The errors are in the
order of the promises passed, regardless of completion order. If the iterable passed is non-empty but
contains no pending promises, the returned promise is still asynchronously (instead of synchronously)
rejected.
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: