Skip to content

Commit 9f2599e

Browse files
committed
docs: update jsdocs for the activate method
1 parent 43d7db4 commit 9f2599e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/route-tree-node.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,23 @@ class RouteTreeNode {
220220

221221
/**
222222
* Cause this route to become the active route. When a route is activated,
223-
* exitCallback functions from the routeData should be called up the tree in order
223+
* routeExit functions from the routeData should be called up the tree in order
224224
* beginning with the previousNodeId until a common node is found with the
225225
* path from the root to this node.
226226
*
227-
* After exitCallback methods have all completed, entryCallbacks should
227+
* After routeExit methods have all completed, beforeEntry and routeEnter callbacks should
228228
* be called in order beginning with the root node down the tree through
229229
* this node.
230230
*
231+
* Route lifecycle methods (`routeExit`, `beforeEnter`, `routeEnter`) can be defined
232+
* in the `routeData` object and/or on the associated `routingElement` (if it
233+
* implements `BasicRoutingInterface`). Both implementations, if they exist,
234+
* will be called for the respective phase. For entry hooks, `beforeEnter`
235+
* is called first, and if either the `routeData`'s or element's `beforeEnter`
236+
* returns `false`, the activation process will stop at the current and subsequent nodes. If
237+
* `routeEnter` returns `false`, subsequent `routeEnter` calls down the tree
238+
* are skipped. The `routingElement` is expected to implement `routeExit` and `routeEnter`.
239+
*
231240
* _Root_
232241
* / \
233242
* A D
@@ -237,13 +246,13 @@ class RouteTreeNode {
237246
* If the current route is "B" and the route for "E" is activated,
238247
* then the following callbacks should be invoked:
239248
*
240-
* B.exitCallback, A.exitCallback, Root.entryCallback,
241-
* D.entryCallback, E.entryCallback
249+
* B.routeExit, A.routeExit, Root.beforeEnter, Root.routeEnter,
250+
* D.beforeEnter, D.routeEnter, E.beforeEnter, E.routeEnter
242251
*
243252
* If the current route is "B" and the route for "C" is activated,
244253
* then the following callbacks should be invoked:
245254
*
246-
* B.exitCallback, Root.entryCallback, A.entryCallback, C.entryCallback
255+
* B.routeExit, Root.beforeEnter, Root.routeEnter, A.beforeEnter, A.routeEnter, C.beforeEnter, C.routeEnter
247256
*
248257
* @param {!string|undefined} previousRouteId
249258
* @param {!Context} context

0 commit comments

Comments
 (0)