Reactive API#

bind(function, *args[, watch])

Given a function, returns a wrapper function that binds the values of some or all arguments to Parameter values and expresses Param dependencies on those values, so that the function can be invoked whenever the underlying values change and the output will reflect those updated values.

rx([obj])

rx allows wrapping objects and then operating on them interactively while recording any operations applied to them.

These methods and properties are available under the .rx namespace of reactive expressions (rx).

bool()

__bool__ cannot be implemented so it is provided as a method.

in_(other)

Replacement for the in statement.

is_(other)

Replacement for the is statement.

is_not(other)

Replacement for the is not statement.

len()

__len__ cannot be implemented so it is provided as a method.

pipe(func, /, *args, **kwargs)

Apply chainable functions.

updating()

Returns a new expression that is True while the expression is updating.

when(*dependencies[, initial])

Returns a reactive expression that emits the contents of this expression only when the dependencies change.

where(x, y)

Returns either x or y depending on the current state of the expression, i.e. replaces a ternary if statement.

value

Returns the current state of the reactive expression by evaluating the pipeline.

watch([fn, onlychanged, queued, precedence])

Adds a callable that observes the output of the pipeline.