- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5k
Closed
Milestone
Description
Here's what I think of the current API:
- The current list of hooks is a bit overwhelming. Do we actually need canActivateandcanDeactivate? It seemsactivateanddeactivatecan already handle most use cases withtransition.abort()andtransition.redirect().
- The datahook name is not that self-explanatory.
- The way we determine the async-ness of these hooks is convoluted. Sync, Promises, callbacks... we should try to simplify it.
Idea
Some potential breaking changes for 0.8.0:
- Remove canActivateandcanDeactivate.
- (Maybe?) Remove canReuse. The same component is always reusable. Handle route change inonChange.
- Rename hooks, now we have just 3 of them:
- onEnter: what- activateused to be.
- onLeave: what- deactivateused to be.
- onChange: what- dataused to be. The new name better explains when it is called (on every route change when the current component is active)
 
- In addition: allow specifying onEnterandonLeavein the route config as well.
- Open to suggestion: how do we simplify hook async-ness?
dsonet, lbineau, fnlctrl, franciscolourenco, jjcodes78 and 2 more