Trait sauron::Component [−][src]
pub trait Component<MSG> where
MSG: 'static, { fn update(&mut self, _msg: MSG) -> Cmd<Program<Self, MSG>>
where
Self: 'static; fn view(
&self
) -> Node<&'static str, &'static str, &'static str, AttributeValue<MSG>>; fn init(&self) -> Cmd<Program<Self, MSG>>
where
Self: 'static, { ... } fn style(&self) -> Vec<String, Global>ⓘ { ... } fn measurements(
&self,
measurements: Measurements
) -> Cmd<Program<Self, MSG>>
where
Self: 'static, { ... } }
Expand description
The app should implement this trait for it to be handled by the Program
Required methods
Called each time an action is triggered from the view
Provided methods
an implementing APP component can have an init function which executes right after the APP is instantiated by the program
optionally a component can specify it’s own css style
fn measurements(&self, measurements: Measurements) -> Cmd<Program<Self, MSG>> where
Self: 'static,
fn measurements(&self, measurements: Measurements) -> Cmd<Program<Self, MSG>> where
Self: 'static,
This is called after dispatching and updating the dom for the component