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

Include the target route in beforeExit #33

Open
daedalus28 opened this issue May 25, 2017 · 0 comments
Open

Include the target route in beforeExit #33

daedalus28 opened this issue May 25, 2017 · 0 comments

Comments

@daedalus28
Copy link

I need to know what the target route is going to be in beforeExit. There are a few use cases for this, like conditionally allowing navigation only between certain routes, or conditionally running cleanup of state if we know it won't be needed on the next page (but leaving it if it is needed, such as in a child routing situation). For now, I can accomplish this by caching the previous view in beforeExit and moving the logic to beforeEnter, but this seems wasteful and kinda dirty.

I'm pretty sure I can do this trivially by just additionally passing view (and maybe even paramsObj and queryParamsObj) on this line:

const beforeExitResult = (rootViewChanged && this.currentView && this.currentView.beforeExit) ? this.currentView.beforeExit(this.currentView, currentParams, store, currentQueryParams) : true;

Thoughts?

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

No branches or pull requests

1 participant