MCPcopy Index your code
hub / github.com/refined-github/refined-github / asyncForEach

Function asyncForEach

source/helpers/async-for-each.ts:2–7  ·  view source on GitHub ↗
(
	iterable: Iterable<Item>,
	iteratee: (item: Item) => Promise<void>,
)

Source from the content-addressed store, hash-verified

1/** Loop an iterable with the ability to place a non-blocking `await` in the loop itself */
2export 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}

Callers 1

addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected