pub trait EffectStoreLike<S, A, E>where
A: Action,{
// Required methods
fn dispatch(&mut self, action: A) -> ReducerResult<E>;
fn state(&self) -> &S;
// Provided method
fn try_dispatch(
&mut self,
action: A,
) -> Result<ReducerResult<E>, DispatchError> { ... }
}Expand description
Effect store interface used by EffectRuntime.
Required Methods§
Sourcefn dispatch(&mut self, action: A) -> ReducerResult<E>
fn dispatch(&mut self, action: A) -> ReducerResult<E>
Dispatch an action and return state changes plus effects.
Provided Methods§
Sourcefn try_dispatch(&mut self, action: A) -> Result<ReducerResult<E>, DispatchError>
fn try_dispatch(&mut self, action: A) -> Result<ReducerResult<E>, DispatchError>
Dispatch an action and return state changes plus effects.
Default behavior wraps Self::dispatch in Ok(...).