Function start

Source
pub fn start<M, Msg, Eff, UF, VF, EF>(
    model: M,
    update_fn: UF,
    view_fn: VF,
    effects_fn: EF,
) -> Result<(), Report>
where M: Clone + Send + Sync + 'static, Eff: Send + Sync + 'static, Msg: From<Event> + Sync + Send + 'static, UF: Fn(M, Msg) -> Result<Update<M, Eff>> + Send + Sync + 'static, VF: Fn(&M) -> Result<View> + Send + Sync + 'static, EF: Fn(&M, Eff) -> Result<Option<Msg>> + Send + Sync + 'static,
Expand description

Starts the runtime which manages all the internal processes and message passing.

The user needs to provide:

  • The initial model

  • An update function, responsible for updating the model based on messages.

  • A view function, responsible for constructing the view from the model.

  • An effects function responsible for handling side effects.