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
Section titled “Import”import { mergeMap } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function mergeMap( project: Project<TIn, TOut>, opts: MergeMapOptions = {},): Operator<TIn, TOut>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
project | Project<TIn, TOut> | project value used by the helper. |
opts | MergeMapOptions | Options that configure the helper. |
Returns
Section titled “Returns”A Operator<TIn, TOut> value.
Example
Section titled “Example”import { mergeMap } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/higher-order.ts