[−][src]Trait mogwai::component::Component
Defines a component with distinct input (model update) and output (view update) messages.
See the module level documentation for more details.
Associated Types
type ModelMsg
A model message comes out from the view through a tx_on function into your component's update function.
type ViewMsg
A view message comes out from your component's update function and changes the view by being used in an rx_* function.
type DomNode
The type of DOM node that represents the root of this component.
Required methods
fn update(
&mut self,
msg: &Self::ModelMsg,
tx_view: &Transmitter<Self::ViewMsg>,
sub: &Subscriber<Self::ModelMsg>
)
&mut self,
msg: &Self::ModelMsg,
tx_view: &Transmitter<Self::ViewMsg>,
sub: &Subscriber<Self::ModelMsg>
)
Update this component in response to any received model messages. This is essentially the component's fold function.
fn view(
&self,
tx: Transmitter<Self::ModelMsg>,
rx: Receiver<Self::ViewMsg>
) -> Gizmo<Self::DomNode>
&self,
tx: Transmitter<Self::ModelMsg>,
rx: Receiver<Self::ViewMsg>
) -> Gizmo<Self::DomNode>
Produce this component's gizmo using inputs and outputs.
Provided methods
fn into_component(self) -> GizmoComponent<Self>
Helper function for constructing a GizmoComponent for a type that implements Component.
Implementations on Foreign Types
impl<T, D> Component for Box<BuilderFn<T, D>> where
T: Clone + 'static,
D: JsCast + AsRef<Node> + Clone + 'static,
[src]
T: Clone + 'static,
D: JsCast + AsRef<Node> + Clone + 'static,