Closed arn-the-long-beard closed 3 years ago
Right now, in order to init our pages we do it this way
fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) { match msg { Msg::UrlChanged(subs::UrlChanged(_)) => { router().current_route().init(model, orders); } // ...remaining arms } }
In the same way we did moved |subs::UrlRequested(requested_url, _)| router().confirm_navigation(requested_url), to the main fn init of the lib.rs.
|subs::UrlRequested(requested_url, _)| router().confirm_navigation(requested_url),
fn init
lib.rs
Lets try it and see if it simplifies the code and respect or improve the semantic of it :smile:
Well. In fact I cannot do this because we need to have an updated Model always. The init of pages has to be made in update anyway.
Right now, in order to init our pages we do it this way
In the same way we did moved
|subs::UrlRequested(requested_url, _)| router().confirm_navigation(requested_url),
to the mainfn init
of thelib.rs
.Lets try it and see if it simplifies the code and respect or improve the semantic of it :smile: