Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/stream_observables/transforms/scan.ts>scan

A collection of observables built with ReadableStreams & friends.
Latest
function scan
import { scan } from "https://deno.land/x/stream_observables@v1.3/transforms/scan.ts";

Reduces the original observable with f, emitting every intermediate result not including the initial value.

Parameters

f: ScanFunc<U, T>

Reduce function called with the accumulated value so far and the current item. Should return a new accumulated value.

v0: U

Initial value.

Returns

Transform that emits accumulated values produced by f.