Skip to content
PACKAGES

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

A Operator<TIn, TOut> value.

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

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