Skip to content

Commit 9cd0c5e

Browse files
committed
docs: multiple before/after hooks
1 parent 1357584 commit 9cd0c5e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/en/api/after-each.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# `router.afterEach(hook)`
22

3-
Set the global after hook, which will be called every time when a route transition successfully **enters the activation phase**.
3+
Add a global after hook, which will be called every time when a route transition successfully **enters the activation phase**.
44

55
Note this hook being called only means the transition has been validated, i.e. all `canDeactivate` and `canActivate` hooks have successfully resolved and the browser URL has been updated. It does not guarantee that all `activate` hooks have been resolved.
66

7-
You can only have one global after hook at a time; however you can implement your own middleware system inside this hook.
7+
You can add multiple global after hooks to the same router. These hooks will be called synchronously in the order of creation.
88

99
### Arguments
1010

docs/en/api/before-each.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# `router.beforeEach(hook)`
22

3-
Set the global before hook, which will be called before every route transition starts. This is before the entire transition pipeline; if the hook rejects the transition, the pipeline won't even be started.
3+
Add a global before hook to the router, which will be called before every route transition starts. This is before the entire transition pipeline; if the hook rejects the transition, the pipeline won't even be started.
44

5-
Note you can only have one global before hook at a time; however you can implement your own middleware system inside this hook.
5+
You can add multiple global before hooks to the same router. These hooks will be called in the order of creation. Since hooks can be resolved asynchronously, the next hook won't be called until the previous one resolves.
66

77
### Arguments
88

0 commit comments

Comments
 (0)