Skip to main content

Example

import { runAll, isSuccess } from "trybox";

const tasks = Array.from({ length: 20 }, (_, i) => async () => i * 2);

const results = await runAll<number>(tasks, {
  concurrency: 5,
  mode: "settle",
});

const values = results.filter(isSuccess).map((r) => r.data);