[go: nahoru, domu]

Skip to content

nmlt/yewdux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yewdux

Ergonomic state management for Yew applications.

See the book for more details.

Example

use yew::prelude::*;
use yewdux::prelude::*;

#[derive(Default, Clone, PartialEq, Eq, Store)]
struct State {
    count: u32,
}

#[function_component]
fn App() -> Html {
    let (state, dispatch) = use_store::<State>();
    let  class="pl-kos">.reduce_mut_callback(|state| state.count += 1);

    html! {
        <>
        <p>{ state.count }</p>
        <button {onclick}>{"+1"}</button>
        </>
    }
}

fn main() {
    yew::Renderer::<App>::new().render();
}

About

Ergonomic state management for Yew apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%