composeui.core.reactivity¶
Reactive methods: view methods that run again when a view field they read changes.
- exception composeui.core.reactivity.ReactiveLoopError[source]¶
Bases:
RuntimeErrorA reactive method set a field that it reads, or methods kept changing each other.
- composeui.core.reactivity.reactive(method)[source]¶
Run this view method again each time a view field that it read changes.
The application runs it once when the app starts, after
setup_model, and records the fields that it reads. A run records them again: a branch not taken isn’t an input. ATask’s state is an input too. An event, such as the callbacks of one signal, runs it once after the event, with the other methods in the order they started. The method must not set a field that it reads. Slow work goes to a task’sTask.start_latest.
- composeui.core.reactivity.reactive_inputs(view)[source]¶
Get the inputs that each reactive method of
viewread in its last run, to debug it.By method name: a field as its path from
view, e.g.filters.hour.value, and a task by its function’s name.
- composeui.core.reactivity.start_reactions(root)[source]¶
Run the reactive methods of
rootand its children once, recording their inputs.The application calls it. A view set later in a field of a started view, e.g. a list’s item, starts its own. A method started already isn’t run again.
- Parameters:
root (View)
- Return type:
None