Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

scan

import { scan } from "https://raw.githubusercontent.com/surma/observables-with-streams/28c55be6d855780c677fd1f4ba975f4d3144891d/src/transforms/scan.ts";

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

function scan<U, T>(f: ScanFunc<U, T>, v0: U): Transform<T, U>;
§
scan<U, T>(f: ScanFunc<U, T>, v0: U): Transform<T, U>
[src]

§Type Parameters

§Parameters

§
f: ScanFunc<U, T>
[src]

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

§
v0: U
[src]

Initial value.

§Return Type

§

Transform that emits accumulated values produced by f.