Function ambient_api::prelude::ambient_element::provide_context
source · pub fn provide_context<T>(
hooks: &mut Hooks<'_>,
default_value: impl FnOnce() -> T
) -> Arc<CbDebuggable<dyn Fn(T) + Sync + Send>>
Expand description
Provide a value which is accessible to all children further down the tree.
Note: This hook does not rely on order, and is therefore safe to use inside conditionals.