pub fn create_effect<T>(f: impl Fn(Option<T>) -> T + 'static)
where T: Any + 'static,
Expand description

Create an Effect that runs the given function whenever the Signals that subscribed to it in the function.

The given function will be run immediately once, and tracks all the signals that subscribed in that run. And when these Signals update, it will rerun the function. And the effect re-tracks the signals in each run, so that it will only be re-run by the Signals that actually ran in the last effect run.