pub struct RenderEffect { /* private fields */ }Expand description
A reactive effect that automatically tracks signal dependencies and re-executes when any dependency changes.
Unlike the global __euv_signal_update__ mechanism which broadcasts to
all DynamicNodes, a RenderEffect only re-runs when signals it actually
reads have changed, enabling fine-grained reactive updates.
Implementations§
Source§impl RenderEffect
Implementation of RenderEffect reactive operations.
impl RenderEffect
Implementation of RenderEffect reactive operations.
Sourcepub fn create<F>(effect_fn: F) -> Selfwhere
F: FnMut() + 'static,
pub fn create<F>(effect_fn: F) -> Selfwhere
F: FnMut() + 'static,
Creates a new RenderEffect that wraps the given closure.
On creation, the closure is executed once immediately. During execution,
any Signal::get() calls will register this effect as a subscriber.
When any of those signals change, the closure is re-executed.
§Arguments
F- The closure to execute reactively.
§Returns
Self- A new RenderEffect handle.
Sourcepub fn dispose(&self)
pub fn dispose(&self)
Marks this effect as disposed and cleans up all its dependencies.
After disposal, run_once becomes a complete no-op. All subscriber
entries for this effect are removed from the global EFFECT_SUBSCRIBERS
registry, preventing the effect from being scheduled or executed again.
This is called when the associated DOM node is removed from the tree
(e.g., during a match arm switch in routing) to prevent stale effects
from causing infinite loops.
Source§impl RenderEffect
impl RenderEffect
pub fn get_mut_inner(&mut self) -> &mut Rc<RefCell<RenderEffectInner>>
Trait Implementations§
Source§impl Clone for RenderEffect
impl Clone for RenderEffect
Source§fn clone(&self) -> RenderEffect
fn clone(&self) -> RenderEffect
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more