method StreamClass.prototype.run
Private
StreamClass.prototype.run(): Task<void, E>

Forces the stream for its side effects alone — Elixir's Stream.run/1. Fail-fast like StreamClass#forEach: pair with StreamClass#tap for the effects.

const seen: number[] = [];
await Stream.from([1, 2]).tap((n) => void seen.push(n)).run();
seen; // [1, 2]

Return Type

Task<void, E>

Usage

import { StreamClass } from "lib/stream/stream.ts";