10 unstable releases (3 breaking)

0.9.2 Feb 23, 2023
0.9.0 Nov 25, 2022
0.7.0 Jan 31, 2022
0.6.2 Jun 6, 2021
0.6.1 Mar 19, 2021

#53 in WebAssembly

Download history 484/week @ 2022-11-29 514/week @ 2022-12-06 556/week @ 2022-12-13 532/week @ 2022-12-20 332/week @ 2022-12-27 488/week @ 2023-01-03 343/week @ 2023-01-10 487/week @ 2023-01-17 555/week @ 2023-01-24 629/week @ 2023-01-31 698/week @ 2023-02-07 896/week @ 2023-02-14 833/week @ 2023-02-21 1062/week @ 2023-02-28 707/week @ 2023-03-07 685/week @ 2023-03-14

3,407 downloads per month
Used in 6 crates

MIT/Apache

70KB
1.5K SLoC

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 onclick = dispatch.reduce_mut_callback(|state| state.count += 1);

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

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

lib.rs:

Yewdux

Simple 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 onclick = dispatch.reduce_mut_callback(|state| state.count += 1);

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

Default exports

Dependencies

~11–18MB
~318K SLoC