Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): Support undefined in NavigationGuardNext #1059

Merged
merged 5 commits into from Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/types/index.ts
Expand Up @@ -370,7 +370,7 @@ export interface NavigationGuardNext {
(): void
(error: Error): void
(location: RouteLocationRaw): void
(valid: boolean): void
(valid: boolean | undefined): void
(cb: NavigationGuardNextCallback): void
/**
* Allows to detect if `next` isn't called in a resolved guard. Used
Expand Down
4 changes: 4 additions & 0 deletions test-dts/navigationGuards.test-d.ts
Expand Up @@ -26,6 +26,10 @@ router.beforeEach((to, from) => {
return false
})

router.beforeEach((to, from, next) => {
next(undefined)
})

// @ts-expect-error
router.beforeEach((to, from, next) => {
return Symbol('not supported')
Expand Down