Skip to main content

Module reactive

Module reactive 

Source

Structs§

Computed
A lazily-recomputed derived value. Reads its sources through get(), so it subscribes to them; when a source changes the cached value is invalidated and recomputed on the next get(). Cheap to clone (shared handle).
ComputedId
Effect
A reactive side effect. Runs its closure once on creation to subscribe to the signals it reads, then re-runs whenever any of them changes. Drop or Effect::dispose to stop and unregister it.
EffectId
Signal

Enums§

Subscriber

Functions§

cleanup_effects_for
Reclaim every effect bound to entity now, instead of waiting for the next flush. For a widget-teardown path to call when it truly despawns a subtree.
effect_with_widget
An effect owned by the runtime and tied to a widget entity: it re-runs on dependency change and lives until the widget is despawned (cleanup later), not until a returned handle drops. Hence no handle is returned — dropping one would immediately unregister the effect.
flush_signal_dirty
Drain queued reactive work once per frame, after systems and before render: re-run dirty effects (which may dirty more), then mark dirty widgets. Dead entities are skipped (no reverse index; subscriber lists may retain despawned entities).
with_world
Reach the World the running effect is under; None outside a flush window. Public so ui!-generated reactive control flow can reach it from user crates.
with_world_scope
Make the World reachable by effect closures while f runs — applies a reactive binding’s initial value at ui! construction, outside the flush.