dioxus/docs/guide/examples/hooks_composed.rs

14 lines
278 B
Rust
Raw Normal View History

#![allow(unused)]
use dioxus::prelude::*;
fn main() {}
struct AppSettings {}
// ANCHOR: wrap_context
fn use_settings(cx: &ScopeState) -> &UseSharedState<AppSettings> {
2022-12-07 23:11:51 +00:00
use_shared_state::<AppSettings>(cx).expect("App settings not provided")
}
// ANCHOR_END: wrap_context