loop-controls
Version:
break/continue controls for loops and higher-order functions (sync, async, concurrent). Designed to compose with ts-pattern.
12 lines • 393 B
TypeScript
import { type Control } from "./core.js";
export type ConcurrentControl = Control & {
signal: AbortSignal;
};
export declare function forEachConcurrent<T>(items: T[], fn: (item: T, control: ConcurrentControl, index: number) => Promise<void>, { concurrency }?: {
concurrency?: number;
}): Promise<{
broken: false;
} | {
broken: true;
}>;
//# sourceMappingURL=concurrent.d.ts.map