Skip to main content

create_render_effect

Function create_render_effect 

Source
pub fn create_render_effect<F>(effect_fn: F) -> RenderEffect
where F: FnMut() + 'static,
Expand description

Creates a new RenderEffect that automatically tracks signal dependencies and re-executes when any dependency changes.

This is the public API for creating reactive effects. During the first execution, any Signal::get() calls establish dependencies. When those signals change, the closure is re-executed with fresh dependency tracking.

§Arguments

  • F - The closure to execute reactively.

§Returns

  • RenderEffect - A handle to the created effect.