-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
feat(types): NavigationGuardNext #2497
Conversation
Exactly the PR I was about to submit.. @posva How do PRs get reviewed/merged? |
I will come at it when I have time, after other Bugs and features |
As a workaround, to grab the
|
Nice @voool, that's really clean! I didn't know that was possible - I've been copying the type def into my own code, which is more verbose and also more brittle (in case the def changes at all). |
Any progress on when this will be merged? |
@posva any progress on this? |
Any update? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm renaming the type to match vue-router-next
One thing that is problematic is that only beforeRouteEnter
's next
allows a callback. So I think we should export a type without the callback and make a specific type for beforeRouteEnter
where we change next
to include (vm: V) => any
types/router.d.ts
Outdated
@@ -7,10 +7,11 @@ type ErrorHandler = (err: Error) => void; | |||
export type RouterMode = "hash" | "history" | "abstract"; | |||
export type RawLocation = string | Location; | |||
export type RedirectOption = RawLocation | ((to: Route) => RawLocation); | |||
export type Next<V extends Vue = Vue> = (to?: RawLocation | false | ((vm: V) => any) | void) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export type Next<V extends Vue = Vue> = (to?: RawLocation | false | ((vm: V) => any) | void) => void; | |
export type NavigationGuardNext<V extends Vue = Vue> = (to?: RawLocation | false | ((vm: V) => any) | void) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I am not familiar with the operation of pr, if it interferes with people, I am sorry. |
No worries for the commit history @beary, we squash commits at the end! Let me know if this is things are not clear and I will finish this up |
@posva |
@beary There is a change left: #2497 (review) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I submitted it for review, but it is still in a reviewable state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that is problematic is that only beforeRouteEnter
's next
allows a callback. So I think we should export a type without the callback and make a specific type for beforeRouteEnter
where we change next
to include (vm: V) => any
@beary because the review is the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed
what? see #2497 (review) |
@posva |
Next
type
Expose a
Next
type for this usage: