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
Wed, May 7, 19:41 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
624792
Default Alt Text
async-foreach.ts (361 B)

Event Timeline