Trait yewdux::store::Store[][src]

pub trait Store: Sized + 'static {
    type Model: Clone;
    type Message;
    type Input;
    type Output;
    fn new(_link: StoreLink<Self>) -> Self;
fn state(&mut self) -> &mut Rc<Self::Model>; fn changed(&mut self) { ... }
fn update(&mut self, _msg: Self::Message) -> Changed { ... }
fn handle_input(&mut self, msg: Self::Input, _who: HandlerId) -> Changed { ... } }

A container for shared state.

Associated Types

Loading content...

Required methods

fn new(_link: StoreLink<Self>) -> Self[src]

Initialize this store.

fn state(&mut self) -> &mut Rc<Self::Model>[src]

Return a mutable reference to current state.

Loading content...

Provided methods

fn changed(&mut self)[src]

Called after state has changed.

fn update(&mut self, _msg: Self::Message) -> Changed[src]

Handle store message, returning whether state has changed.

fn handle_input(&mut self, msg: Self::Input, _who: HandlerId) -> Changed[src]

Handle store input message, returning whether state has changed.

Loading content...

Implementors

impl<T> Store for BasicStore<T> where
    T: Clone + Default + 'static, 
[src]

type Model = T

type Message = ()

type Input = ()

type Output = ()

impl<T> Store for PersistentStore<T> where
    T: Default + Clone + Persistent + 'static, 
[src]

type Model = T

type Message = ()

type Input = ()

type Output = ()

impl<T> Store for ReducerStore<T> where
    T: Reducer + Clone + 'static, 
[src]

type Model = T

type Message = ()

type Input = T::Action

type Output = ()

Loading content...