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

Proposal: onBefore hooks should not be handled synchronously #40

Closed
christopherthielen opened this issue Feb 12, 2017 · 1 comment
Closed

Comments

@christopherthielen
Copy link
Member

We currently allow onBefore hooks to either synchronously return a HookResult a transition, or to return a promise. This was initially created to implement the synchronous $stateChangeStart polyfill.

However, having onBefore be handled differently than the other hooks has caused additional edge cases, and has been at the root of a number of reported bugs. It also increases the code size and complexity. My gut feel is that removing synchronous handling code will make transition hooks easier to reason about.

I propose that onBefore is handled as a normal async hook, very similar to onStart hooks. It seems most likely that any end users who currently use onBefore will be unaware of the change in implementation.

@christopherthielen
Copy link
Member Author

Closed by 30b82aa

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