pub fn run_in_mutable_snapshot<T>(
block: impl FnOnce() -> T,
) -> Result<T, &'static str>Expand description
Runs the provided closure inside a mutable snapshot and applies the result.
UI event handlers should wrap state mutations in this helper so that recomposition observes the updates atomically once the snapshot applies.
ยงImportant
ALL UI event handlers (keyboard, mouse, touch, animations, custom modifier nodes)
that modify MutableState MUST use this function or dispatch_ui_event.
Without it, state changes may not be visible to other snapshot contexts.