New triggers implementation with redirect support#172
Conversation
We don't support older browsers But at least, this allow us to run tests inside Phantom
|
@delgermurun check this. Give it a try and help me to figure out any issues? |
There was a problem hiding this comment.
Check how flush behave if a user change the route from a template helper.
That's weird. But possible.
|
@arunoda Nice refactoring! Working good. What's the issues :)? |
|
@delgermurun I mean if there are any issues :) |
|
Everything looks good. I think we can do a release. |
|
Yeah. Do it. |
|
This is perfect, thanks Aronuda 👍 |
|
I'm trying to redirect to a sub-route of the current route, for instance from /foo to /foo/bar. This works (shows the right template for the router), but the URL ifself is not updated (still shows /foo). The same applies to my navigation bar which is testing for the route to highlight the right navigation elements. If I'm using FlowRouter.go() instead of redirect(), the same happens. How can I update the URL and my navigation template once a redirect happens? |
This is a re-implementation with our triggers API with redirect support with a clean codebase.
This is the implementation of the redirect API.
When someone route to
/then he'll be redirected to/some-other-path. In this case, action won't get called or any exit trigger if exists.This can be done for exit triggers as well.
We can also do this prevent route changes like this.
In the above case, it is impossible to leave from route
/.Here are some properties of redirect