( iterable: Iterable<Item>, iteratee: (item: Item) => Promise<void>, )
| 1 | /** Loop an iterable with the ability to place a non-blocking `await` in the loop itself */ |
| 2 | export default async function asyncForEach<Item>( |
| 3 | iterable: Iterable<Item>, |
| 4 | iteratee: (item: Item) => Promise<void>, |
| 5 | ): Promise<void> { |
| 6 | await Promise.all([...iterable].map(async item => iteratee(item))); |
| 7 | } |