Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Router #97

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Simplify Router #97

merged 2 commits into from
Apr 11, 2024

Conversation

maciejhirsz
Copy link
Owner

Building upon #95:

  • 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.

@maciejhirsz maciejhirsz merged commit 3eb6dd8 into master Apr 11, 2024
4 checks passed
@maciejhirsz maciejhirsz deleted the router branch April 11, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant