BACK
ReferencemergeScan
Reference · 77

mergeScan

mergeScan

rxjs.dev

Scan where the accumulator returns an Observable.

Signature

mergeScan(accumulator: (acc: R, value: T, index: number) => ObservableInput, seed: R, concurrent?: number): OperatorFunction

What it does

Like scan, but the accumulator can be async and returns an Observable. Each inner's result becomes the new accumulator state.

When to use

Async state: accumulating via HTTP, a stateful command queue, workflows with effects.

See also

scan, mergeMap, switchScan

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...