Skip to content

@maxhealth.tech/prefab / rx

rx

Classes

ClassDescription
RefA lazy, serializable reference to a row in a collection. The expression is evaluated at runtime by the renderer's pipe evaluator.
CollectionA named keyed array. Serializes rows into state and provides typed lookup helpers that compile to pipe expressions.
RxRx — Reactive expression builder.
SignalA named reactive scalar. Carries a state key, an initial value, and produces rx expressions for component props.

Interfaces

InterfaceDescription
SignalOptions-

Type Aliases

Type AliasDescription
PipeFnA pipe function receives the current value and optional arguments.
SignalValueAllowed signal value types — intentionally excludes objects/arrays.

Variables

VariableDescription
ITEMCurrent item in a ForEach loop
INDEXCurrent index in a ForEach loop
EVENTValue from an interaction event (input value, checkbox state, etc.)
ERRORError message available in on_error callbacks
RESULTReturn value available in on_success callbacks
STATESTATE proxy — convenience for accessing state keys. Usage: STATE.foo → rx('foo'), STATE.user.name → rx('user.name')

Functions

FunctionDescription
collectionCreate a named keyed collection.
registerPipeRegister a custom pipe filter. Re-registration warns and overwrites (HMR-friendly). Built-in pipes in applyFilter always shadow custom pipes.
unregisterPipeRemove a custom pipe (useful in tests). Returns true if it existed.
listPipesList all registered custom pipe names (useful for debugging).
rxCreate an Rx expression referencing a state key
signalCreate a named reactive signal.

Released under the MIT License.