Skip to main content
Routing operators choose which values and declarations can materialize in one context. They do not coordinate separate occurrences across contexts.

gate()

gate(value, condition) emits value when condition emits true and closes when it emits false or closes. A failed condition fails the gate. The runtime decides the condition before materializing value, so a closed path does not wait for it.
gate preserves a keyed or global partition carried by value.

filter()

filter(signal, predicate) emits the original value when the predicate returns true and closes otherwise. Type-guard predicates narrow the output type.
filter is a value-preserving gate and retains the source’s keyed or global partition.

partition()

partition(signal, predicate) returns complementary paths. Exactly one emits the original value; the other closes.
Both outputs retain the source’s keyed or global partition. Use filter when only one path matters and branch when each path declares different work.

scope()

scope(dependencies, section, options?) makes every durable operation declared synchronously in section wait for one signal or a non-empty signal tuple. A directly returned signal also inherits the dependencies. Other return values pass through unchanged.
Use scope(section, options?) when only an isolated durable hook namespace is needed. Options accept name and presentation: "collapsed" | "expanded" | "hidden". Named scopes default to collapsed; unnamed scopes default to hidden.

branch()

branch(condition, whenTrue, whenFalse?) traverses complementary synchronous sections while making only the selected section ready.
When both sections return signals, branch returns the selected result. With only a true section, its returned signal closes when the condition is false. branch composes complementary gates, scopes, and declaration-order fallback. See fallback for direct declaration-order selection and cross-context coordination for joining separate occurrences.