Skip to content

struct

Effect

pub struct Effect {
    /* private fields */
}

A side effect that tracks the signals it reads and re-runs when they change. The effect lives as long as a handle (or an Owner) holds it.

Methods

new

pub fn new(f: impl FnMut() + 'static) -> Self

Create an effect and run it immediately.

run

pub fn run(&self)

Run the effect now, regardless of whether its dependencies changed.

dispose

pub fn dispose(&self)

Stop the effect permanently and release its subscriptions.

is_disposed

pub fn is_disposed(&self) -> bool

Whether [Effect::dispose] has been called.

Trait implementations