yester
yester copied to clipboard
Fallthrough Routes
@basarat
I've been running yester in production for several months now, working great. However I've run into a particular case multiple times and wonder if you have any thoughts on this:
I want to be able to have routes that fall through, i.e. they match multiple, nested routes. For example:
/test/* and /test/test2 would match both routes, and if i were to go to /test/test3 the beforeUnload would only be called on the /test/test2 route (since we haven't left /test/*). This would allow me to handle repetitive data loading tasks without doing it multiple times, nest route views, etc.
What are your thoughts?
I also noticed that having a route like /test/* and going to /test/test1/ does not give me any remaining path, which leads to other complications. Is this on purpose?
This would allow me to handle repetitive data loading tasks without doing it multiple times, nest route views, etc.
You can simply move out the functions and call them as needed. Pseudo logic:
- child:
- parentLeave(); childLeave();
- parent :
- parentLeave();