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

Early detection of component change for triggering leaving hook #35

Open
kuy opened this issue Jan 2, 2017 · 0 comments
Open

Early detection of component change for triggering leaving hook #35

kuy opened this issue Jan 2, 2017 · 0 comments

Comments

@kuy
Copy link
Owner

kuy commented Jan 2, 2017

The leaving hooks are triggered when CHANGE_COMPONENT action is dispatched, not URL change.

  1. Open blog example
  2. Login
  3. Go to post edit page
  4. Change title
  5. Click Posts link in navigation
  6. Start loading
  7. Finish loading and dispatch CHANGE_COMPONENT action
  8. Detect it and trigger leaving hook

This behavior is correct, but I want to run the leaving hook without waiting the load.
If a route action is simple (this means that it doesn't contain if-else statements), the tower can detect before running it and trigger the leaving hook, because the action is just a generator function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant