Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware<A>
where A: Action,
{ // Required methods fn before(&mut self, action: &A); fn after(&mut self, action: &A, state_changed: bool); }
Expand description

Middleware trait for intercepting actions

Implement this trait to add logging, persistence, or other cross-cutting concerns to your store.

Required Methods§

Source

fn before(&mut self, action: &A)

Called before the action is dispatched to the reducer

Source

fn after(&mut self, action: &A, state_changed: bool)

Called after the action is processed by the reducer

Implementations on Foreign Types§

Source§

impl<A> Middleware<A> for DebugActionRecorder<A>
where A: Action,

Source§

fn before(&mut self, action: &A)

Source§

fn after(&mut self, _action: &A, _state_changed: bool)

Implementors§