Skip to content

Commit

Permalink
Fix createRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
pleek91 committed Jan 3, 2024
1 parent cdd8e85 commit e0443a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilities/createRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Resolved, Route, RouteMethods, Routes } from '@/types'
import { createRouteMethods, resolveRoutes } from '@/utilities'
import { resolveRoutesRegex } from '@/utilities/resolveRoutesRegex'
import { routeMatch } from '@/utilities/routeMatch'
import { updateWindowLocation } from '@/utilities/updateWindowLocation'
import { updateBrowserUrl } from '@/utilities/updateBrowserUrl'

type RouterPush = (url: string, options?: { replace: boolean }) => Promise<void>
type RouterReplace = (url: string) => Promise<void>
Expand Down Expand Up @@ -32,7 +32,7 @@ export function createRouter<T extends Routes>(routes: T): Router<T> {
const match = routeMatch(resolvedWithRegex, url)

if (!match) {
return updateWindowLocation(url, options)
return updateBrowserUrl(url, options)
}

throw 'not implemented'
Expand Down

0 comments on commit e0443a7

Please sign in to comment.