Skip to main content

effect

Function effect 

Source
pub fn effect<F>(f: F) -> Dispose
where F: FnOnce() -> Dispose + 'static,
Expand description

Runs f() immediately and returns its Dispose, registering cleanup on the current scope when one exists. Like scoped_effect, this runs on every call - for mount-once semantics use scoped_effect_once or disposable_effect.