switchMap()
switchMap: project each source value to an inner; on a new source value, CANCEL the in-flight
inner (its source _deactivates — abortInFlight) and switch to the new one. Only the current
inner’s emissions are forwarded.
Import
Section titled “Import”import { switchMap } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function switchMap(project: Project<TIn, TOut>): Operator<TIn, TOut>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
project | Project<TIn, TOut> | project value used by the helper. |
Returns
Section titled “Returns”A Operator<TIn, TOut> value.
Example
Section titled “Example”import { switchMap } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/higher-order.ts