Page MenuHomeSealhub

async-foreach.ts
No OneTemporary

async-foreach.ts

/* eslint-disable @typescript-eslint/no-explicit-any */
// warning - things might get executed out of order
export default async function asyncForEach<T = any>(
array: T[],
fn: (obj: T) => Promise<void>
): Promise<void> {
const promises: Promise<void>[] = [];
for (const element of array) {
promises.push(fn(element));
}
await Promise.all(promises);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 20:32 (23 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
554754
Default Alt Text
async-foreach.ts (361 B)

Event Timeline