The way it was built there was no reason for putting the router in an Rc that I can see.
I've removed the Params hashmap and the whole need to pass it over the browser state, instead a newtype wrapper over matchit::Params is being piped into the route functions.
The Params::get method replaces get_param.
I've hidden the start_route function in the add_route method and made it an implementation detail (removed pub).
Removed route_view! macro as add_route just accepts a regular Fn(Params) -> impl View closure.
The startup can also be simplified, but we'll need way to turn arbitrary impl View into a dynamic boxed view type (with a boxed product) first.
Building upon #95:
Rc
that I can see.Params
hashmap and the whole need to pass it over the browser state, instead a newtype wrapper overmatchit::Params
is being piped into the route functions.Params::get
method replacesget_param
.start_route
function in theadd_route
method and made it an implementation detail (removedpub
).route_view!
macro asadd_route
just accepts a regularFn(Params) -> impl View
closure.The startup can also be simplified, but we'll need way to turn arbitrary
impl View
into a dynamic boxed view type (with a boxed product) first.