Skip to main content

app_environment

Function app_environment 

Source
pub fn app_environment<T>(make: impl FnOnce() -> T) -> T
where T: Clone + 'static,
Expand description

The app-wide T: created on the reactive root scope the first time it is asked for, and returned unchanged by every later call (docs/state.md).

The counterpart to with_environment’s subtree scope: state that belongs to the app rather than to a window or a page, reachable from every window, every menu action, and every task, and alive for as long as the process. make runs at most once.

Day API ↩ Guides· daybrite.dev