Skip to content

Commit ca4275a

Browse files
posvanicolas-ttrickstival
authored
Apply suggestions from code review
Co-Authored-By: Nicolas Turlais <[email protected]> Co-Authored-By: Patrick <[email protected]>
1 parent 11111da commit ca4275a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

active-rfcs/0000-router-navigation-failures.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ router.push('/url').catch(err => {
3737
In **all** other cases, the promise is resolved. We can know if the navigation failed or not by checking the resolved value:
3838

3939
```js
40-
promise.push('/dashboard').then(failure => {
40+
router.push('/dashboard').then(failure => {
4141
if (failure) {
4242
failure instanceof Error // true
4343
failure.type // NavigationFailure.canceled
@@ -58,7 +58,7 @@ It's the global equivalent of `router.push().catch()`
5858
The current behavior of Vue Router regarding the promise returned by `push` is inconsistent with `router.afterEach` and `router.onError`. Ideally, we should be able to catch all succeeded and failed navigations globally and locally but we can only do it locally.
5959

6060
- `onError` is only triggered on thrown errors and `next(new Error())`
61-
- `afterEach` is only called iif there is a navigation
61+
- `afterEach` is only called if there is a navigation
6262
- `redirect` should behave the same as `next('/url')` in a Navigation guard
6363

6464
The differences between the Promise resolution/rejection vs `router.afterEach` and `router.onError` are inconsistent and confusing.

0 commit comments

Comments
 (0)