pub trait DispatchStore<S, A>where
A: Action,{
// Required methods
fn dispatch(&mut self, action: A) -> bool;
fn state(&self) -> &S;
// Provided method
fn try_dispatch(&mut self, action: A) -> Result<bool, DispatchError> { ... }
}Expand description
Store interface used by DispatchRuntime.
Required Methods§
Provided Methods§
Sourcefn try_dispatch(&mut self, action: A) -> Result<bool, DispatchError>
fn try_dispatch(&mut self, action: A) -> Result<bool, DispatchError>
Dispatch an action and return whether the state changed.
Default behavior wraps Self::dispatch in Ok(...).