mobilizon.chapril.org-mobil.../js/src/utils/asyncForEach.ts
Thomas Citharel 594d5a91ec
Upgrade deps
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-12-14 09:23:29 +01:00

13 lines
365 B
TypeScript

async function asyncForEach(
array: Array<any>,
// eslint-disable-next-line no-unused-vars
callback: (arg0: any, arg1: number, arg2: Array<any>) => void
): Promise<void> {
for (let index = 0; index < array.length; index += 1) {
// eslint-disable-next-line no-await-in-loop
await callback(array[index], index, array);
}
}
export { asyncForEach };