Skip to main content

Signature

allOrThrow<T>(tasks, options?): Promise<T[]>

Options

  • Inherits all run options
  • concurrency: simultaneous limit

Example

import { allOrThrow } from "tryo";

const data = await allOrThrow<string>(
  [
    () => fetch("/a").then((r) => r.text()),
    () => fetch("/b").then((r) => r.text()),
  ],
  { concurrency: 2 }
);
If a task fails, the normalized error is thrown.