[][src]Trait sauron_core::dom::Component

pub trait Component<MSG> where
    MSG: 'static, 
{ pub fn update(&mut self, _msg: MSG) -> Cmd<Self, MSG>
    where
        Self: Sized + 'static
;
pub fn view(&self) -> Node<MSG>; pub fn init(&self) -> Cmd<Self, MSG>
    where
        Self: Sized + 'static
, { ... }
pub fn style(&self) -> Vec<String> { ... } }

The app should implement this trait for it to be handled by the Program

Required methods

pub fn update(&mut self, _msg: MSG) -> Cmd<Self, MSG> where
    Self: Sized + 'static, 
[src]

Called each time an action is triggered from the view

pub fn view(&self) -> Node<MSG>[src]

Returns a node on how the component is presented.

Loading content...

Provided methods

pub fn init(&self) -> Cmd<Self, MSG> where
    Self: Sized + 'static, 
[src]

an implementing APP component can have an init function which executes right after the APP is instantiated by the program

pub fn style(&self) -> Vec<String>[src]

optionally a component can specify it's own css style

Loading content...

Implementors

Loading content...