UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

16 lines (15 loc) 634 B
/** * * Promise.any implementation * * just ref the [MDN document](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) * * `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 * * @since 5.7.0 * @category Async * @param iterable * * @throws Error list */ export declare function any<T>(iterable: Iterable<Promise<T>>): Promise<T>;