B:BD[
2.517798] → [
2.517798:517854]
view! { <h1 class="font-bold text-4xl">Hello</h1> }
view! {
<GameProvider>
<h1 class="font-bold text-4xl">Hello</h1>
</GameProvider>
}
}
#[derive(Debug, Default)]
pub struct Game {}
#[derive(Debug, Clone, Copy)]
pub struct GameReader(ReadSignal<Game>);
#[derive(Debug, Clone, Copy)]
pub struct GameWriter(WriteSignal<Game>);
#[component]
fn GameProvider(children: Children) -> impl IntoView {
let (game, set_game) = create_signal(Game::default());
provide_context(GameReader(game));
provide_context(GameWriter(set_game));
children()