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

switchScan

Applies an accumulator function over the source Observable where the accumulator function itself returns an Observable, emitting values only from the most recently returned Observable.

It's like mergeScan, but only the most recent Observable returned by the accumulator is merged into the outer Observable.

function switchScan<T, R, O extends ObservableInput<any>>(accumulator: (
acc: R,
value: T,
index: number,
) => O
, seed: R): OperatorFunction<T, ObservedValueOf<O>>;
§
switchScan<T, R, O extends ObservableInput<any>>(accumulator: (acc: R, value: T, index: number) => O, seed: R): OperatorFunction<T, ObservedValueOf<O>>
[src]

§Type Parameters

§
O extends ObservableInput<any>
[src]

§Parameters

§
accumulator: (acc: R, value: T, index: number) => O
[src]

The accumulator function called on each source value.

§
seed: R
[src]

The initial accumulation value.

§Return Type

§

A function that returns an observable of the accumulated values.