Closed fatfingers23 closed 2 months ago
I have hit all the goals I had in the original draft post 🎉. At this point I have hit everything I can see for an initial router besides what is listed at the bottom. I think this is a decent start I think that can be built on. So I am going flip the PR to publish. Please let me know of any performance changes or suggestions you may have!
JsValue
of the views in the matchit::Router
and then conditionally rendering them out. But gave up on that because I realized it was rendering each one on the first load during the add_route
method when it got the JsValue
from the view.Fn()
which is a closure to render that view
Params from the URL are now loaded in the same pushstate
event handler. It loads them into history.state
, and then get_params
reads from that. I was not able to personally find a way to completely get away from having get_params
because I could not find a good way to pass them to the Fn()
I am using in the matchit::Router
routerView
. The idea is to have eventually a <router-view>
like thing found in Vue Router. Where you can have your nav bar outside of the router-view, then as you navigate the app, it just loads what is inside of that router_view!
works like view!
pushState
with data that is pushed with it to send more complex data structures to routesStrings
that I think could be better handled
TODOS
matchit::Router<>
, probably a fn -> JsValue that can take a paramArc<Mutex<Routes>>
toRc<RefCell<Routes>>
pushstate
for routing and create navigation methods