Skip to content
PACKAGES

operators.switch_map

Kind: function

Source: src/graphrefly/operators/_higher_order.py:206

switch_map(g: Graph, outer: Node[Any], project: Callable[[Any], Any], *, name: str | None = None, recipe: Recipe | None = None)

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.