Trait IEffect

Source
pub trait IEffect {
    // Required method
    fn run(&self);
}
Expand description

A non-generic trait for reactive effects.

IEffect serves as a type-erased trait for Effect<F> instances. By implementing IEffect, an Effect<F> can be stored as Rc<dyn IEffect> regardless of the specific closure type F. This allows the reactive system to manage multiple effects uniformly without exposing the generic type.

Required Methods§

Source

fn run(&self)

Runs the effect closure.

Typically called by the reactive system when dependencies change.

Implementors§

Source§

impl<F> IEffect for Effect<F>
where F: Fn(),