mobilizon.chapril.org-mobil.../js/src/utils/asyncForEach.ts
Thomas Citharel b36ce27bbe
Improve some utils modules
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-08-29 16:52:18 +02:00

11 lines
265 B
TypeScript

async function asyncForEach(
array: Array<any>,
callback: (arg0: any, arg1: number, arg2: Array<any>) => void
): Promise<void> {
for (let index = 0; index < array.length; index += 1) {
callback(array[index], index, array);
}
}
export { asyncForEach };