You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 useonBefore
will be unaware of the change in implementation.The text was updated successfully, but these errors were encountered: