Skip to content

Commit

Permalink
fix(types): explicit types on navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 10, 2020
1 parent 889f86c commit 36d218c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/RouterLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { isSameRouteLocationParams, isSameRouteRecord } from './location'
import { routerKey, routeLocationKey } from './injectionSymbols'
import { RouteRecord } from './matcher/types'
import { assign } from './utils'
import { NavigationFailure } from './errors'

export interface RouterLinkOptions {
/**
Expand Down Expand Up @@ -107,7 +108,9 @@ export function useLink(props: UseLinkOptions) {
isSameRouteLocationParams(currentRoute.params, route.value.params)
)

function navigate(e: MouseEvent = {} as MouseEvent) {
function navigate(
e: MouseEvent = {} as MouseEvent
): Promise<void | NavigationFailure> {
if (guardEvent(e))
return router[unref(props.replace) ? 'replace' : 'push'](unref(props.to))
return Promise.resolve()
Expand Down

0 comments on commit 36d218c

Please sign in to comment.