Member of the starry suite—modular functions for iterable objects.
npm install starry.async-raceMember of the starry suite—modular functions for iterable objects.
 
typescript
function asyncRace(
iterable: Iterable,
asyncAction: (item: T) => PromiseLike
)
`
Returns a promise that resolves with the first, of the return values of asyncAction called upon each element of iterable, which resolved.
Parameters:
* iterable: Iterable - An iterable collection
* asyncAction: (T) => PromiseLike - A thenable called with each item
Returns: Promise
A handy shortcut for:
`javascript
Promise.race([].map(async function() { ... }))
``