Skip to content
PACKAGES

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 { mergeMap } from "@graphrefly/ts/operators";
function mergeMap(
project: Project<TIn, TOut>,
opts: MergeMapOptions = {},
): Operator<TIn, TOut>
ParameterTypeDescription
projectProject<TIn, TOut>project value used by the helper.
optsMergeMapOptionsOptions that configure the helper.

A Operator<TIn, TOut> value.

import { mergeMap } from "@graphrefly/ts/operators";

packages/ts/src/graph/higher-order.ts