Module yewdux::dispatch

source ·
Expand description

This module defines how you can interact with your Store.

use yewdux::prelude::*;

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

let dispatch = Dispatch::<State>::global();
dispatch.reduce_mut(|state| state.count = 1);

let state = dispatch.get();

assert!(state.count == 1);

Structs