Function leptos::batch

source ·
pub fn batch<T>(f: impl FnOnce() -> T) -> T
Expand description

Batches any reactive updates, preventing effects from running until the whole function has run. This allows you to prevent rerunning effects if multiple signal updates might cause the same effect to run.

§Panics

Panics if the runtime has already been disposed.

To avoid panicking under any circumstances, use try_batch.