type alias Stream

The exported value: builders (Stream.from, Stream.unfold, Stream.lines) are the only entry points — there is no public constructor and no call form.

const stream = Stream.from([1, 2, 3]);
await stream.map((n) => n + 1).collect(); // [2, 3, 4]

The type spelling: a signature says Stream<Row, BadRow> while the same identifier builds one — the Task naming pattern, applied to the third shape.

const rows = (): Stream<number> => Stream.from([1, 2, 3]);
await rows().collect(); // [1, 2, 3]

Type Parameters

E = never

Definition

StreamClass<T, E>
variable Stream

The exported value: builders (Stream.from, Stream.unfold, Stream.lines) are the only entry points — there is no public constructor and no call form.

const stream = Stream.from([1, 2, 3]);
await stream.map((n) => n + 1).collect(); // [2, 3, 4]

The type spelling: a signature says Stream<Row, BadRow> while the same identifier builds one — the Task naming pattern, applied to the third shape.

const rows = (): Stream<number> => Stream.from([1, 2, 3]);
await rows().collect(); // [1, 2, 3]

Type Parameters

E = never

Definition

StreamClass<T, E>

Usage

import { Stream } from "lib/stream/index.ts";