param.Parameter.rx#

property Parameter.rx#

The reactive operations namespace.

Provides reactive versions of operations that cannot be made reactive through operator overloading. This includes operations such as .rx.and_ and .rx.bool.

Calling this namespace (.rx()) creates and returns a reactive expression, enabling dynamic updates and computation tracking.

Returns:

A reactive expression representing the operation applied to the current value.

Return type:

rx

References

For more details, see the user guide: https://param.holoviz.org/user_guide/Reactive_Expressions.html#special-methods-on-rx

Examples

Create a Parameterized instance and access its reactive operations property:

>>> import param
>>> class P(param.Parameterized):
...     a = param.Number()
>>> p = P(a=1)

Retrieve the current value reactively:

>>> a_value = p.param.a.rx.value

Create a reactive expression by calling the namespace:

>>> rx_expression = p.param.a.rx()

Use special methods from the reactive ops namespace for reactive operations:

>>> condition = p.param.a.rx.and_(True)
>>> piped = p.param.a.rx.pipe(lambda x: x * 2)