API Reference
mergeMap()
mergeMap (a.k.a. flatMap): project each source value to an inner and keep ALL inners live, interleaving their emissions. A completed inner is removed (memory bounding). On source/inner ERROR or projector failure, every live inner is removed before the operator emits ERROR (D81).
Import
import { mergeMap } from "@graphrefly/ts/operators";
Signature
function mergeMap(
project: Project<TIn, TOut>,
opts: MergeMapOptions = {},
): Operator<TIn, TOut>
Parameters
| Parameter | Type | Description |
|---|---|---|
project | Project<TIn, TOut> | project value used by the helper. |
opts | MergeMapOptions | Options that configure the helper. |
Returns
A Operator<TIn, TOut> value.
Example
import { mergeMap } from "@graphrefly/ts/operators";
Source
packages/ts/src/graph/higher-order.ts