dioxus/docs/guide/examples/hooks_composed.rs
2023-03-14 16:21:39 -05:00

13 lines
278 B
Rust

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