operators.switch_map
operators.switch_map
Section titled “operators.switch_map”Kind: function
Source: src/graphrefly/operators/_higher_order.py:206
Signature
Section titled “Signature”switch_map(g: Graph, outer: Node[Any], project: Callable[[Any], Any], *, name: str | None = None, recipe: Recipe | None = None)Description
Section titled “Description”Follow the Node project returns for the latest outer value, releasing the one
before it, and send its DATA (O-switchMap). After the outer’s COMPLETE it ends when the
selected inner ends, or at once when none is selected. Given a recipe that builds
project, it can be restored.
The behavior is the root’s operator contract: the operator contracts.