Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/effection/lib/mod.ts>all

Structured concurrency and effects for JavaScript
Latest
function all
import { all } from "https://deno.land/x/effection@4.0.0-alpha.1/lib/mod.ts";

Block and wait for all of the given operations to complete. Returns an array of values that the given operations evaluated to. This has the same purpose as Promise.all.

If any of the operations become errored, then all will also become errored.

Example

import { all, expect, main } from 'effection';

await main(function*() {
 let [google, bing] = yield* all([
   expect(fetch('http://google.com')),
   expect(fetch('http://bing.com')),
  ]);
 // ...
});

Type Parameters

T extends readonly Operation<unknown>[] | []

Parameters

ops: T

a list of operations to wait for

Returns

Operation<All<T>>

the list of values that the operations evaluate to, in the order they were given