pub fn dispatch(&mut self, action: Action) {
        if self.middleware.is_empty() {
            self.dispatch_reducer(action);
        } else {
            self.dispatch_middleware(0, action);
        }
    }
/// Dispatches an action which is handles by the reducer, after the store got passed through the middleware.
/// This can modify the state within the store.
///
/// # Example
///
/// ```
/// # use redux_rs::Store;
/// #
/// # type State = i8;
/// #
/// enum Action {
///     DoSomething,
///     DoSomethingElse
/// }
///
/// // ...
///
/// # fn reducer(state: &u8, action: Action) -> u8 {
/// #     0
/// # }
/// #
/// # let mut store = Store::new(reducer, 0);
/// #
/// store.dispatch(Action::DoSomething);
/// println!("Current state: {}", store.state());
/// ```
Dispatches an action which is handles by the reducer, after the store got passed through the middleware.
This can modify the state within the store.
Dispatches an action which is handles by the reducer after the store got passed through the middleware . This can modify the state within the store .
pub fn dispatch(&mut self, action: Action) {
        if self.middleware.is_empty() {
            self.dispatch_reducer(action);
        } else {
            self.dispatch_middleware(0, action);
        }
    }
pub fn dispatch ( & mut self , action : Action ) { if self . middleware . is_empty ( ) { self . dispatch_reducer ( action ) ; } else { self . dispatch_middleware ( 0 , action ) ; } }
Dispatches an action which is handles by the reducer, after the store got passed through the middleware.
Dispatches an action which is handles by the reducer after the store got passed through the middleware .
&mut self
action
Action
&mut self
action
Action
example
None
use redux_rs::store;
None
type state = i8;
enum Action {
DoSomething,
DoSomethingElse
}


enum Action { DoSomething DoSomethingElse }
fn reducer(state: &u8, action: action) -> u8 {
None
0
None
}
None
let mut store = store::new(reducer, 0);
store.dispatch(Action::DoSomething);
println!("Current state: {}", store.state());
```
store . dispatch ( Action :: DoSomething ) ; println! ( " Current state : {} " store . state () ) ; ` ` `