Middleware

Trait Middleware 

Source
pub trait Middleware<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

Implementors§