method Stream.successes
Stream.successes(): AsyncIterable<T>

Returns an async iterable of all successful values emitted by the stream. If any errors were collected during the stream processing, they will be ignored in this iterable.

Examples

Example 1

import { Stream } from "anabranch";

const stream = Source.from<number, string>(async function* () {
  yield 1;
  yield 2;
});

for await (const value of stream.successes()) {
  console.log("Success:", value);
}

Return Type

AsyncIterable<T>

Usage

import { type Stream } from ".";