Skip to main content

Example

import { all, isSuccess } from "tryo";

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

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

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