-
Notifications
You must be signed in to change notification settings - Fork 21
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
Routing #5
Comments
Well I haven't implemented any routing apps yet. At the most basic level I can think of the following scheme. However it would be good to brainstorm on an ideal API. So let's say we have
That would handle the routing only once in the beginning. So to handle routing changes in real time we can put in a short circuit operation at the top level -
This will abort the current widget when the route changes, and redraw the widget for the new route. |
I ended up using the ghcjs-servant-router library (https://github.com/plow-technologies/servant-ghcjs-router), but I modified it so all the routes return a concur Widget and the |
@mpdairy that is awesome! An example demo would be great! |
Have you thought about a clever way to do routing with Concur? I'm planning on using something like
servant-router
to parse a Servant API in the client and then load the correct corresponding widget, and something likeghcjs-servant-client
to generate functions to jump to the route (maybe just by doing a JS History pushState).Then I think I'd just need a loop at the bottom that listened for changes to the location/history state and loaded the new widget / killing the old one.
But the big downside of this is that whenever I want to route a change I can't use the nice monad flow to do menus like in your example, plus it seems pretty bad to be able to jump to any other route within any widget; it could turn to spaghetti real fast.
The text was updated successfully, but these errors were encountered: