pub mod basic;
mod link;
pub mod persistent;
pub mod reducer;
use std::rc::Rc;
pub use yew::agent::HandlerId;
pub use link::StoreLink;
pub type Changed = bool;
pub(crate) type Reduction<T> = Rc<dyn Fn(&mut T)>;
pub(crate) type ReductionOnce<T> = Box<dyn FnOnce(&mut T)>;
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 {
false
}
#[allow(unused_variables)]
fn handle_input(&mut self, msg: Self::Input, _who: HandlerId) -> Changed {
false
}
}