]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: remove old comments, add wip base to history
authorEduardo San Martin Morote <posva13@gmail.com>
Sat, 12 Oct 2019 15:03:41 +0000 (17:03 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Sat, 12 Oct 2019 15:03:41 +0000 (17:03 +0200)
src/history/abstract.2.ts
src/history/common.ts
src/history/html5.2.ts

index 3aeb6f3265c4dbe0dba2392f59a1409447c03c87..8ce4e3bbe2f05de584613d7a8c66c9ac015e97b6 100644 (file)
@@ -11,8 +11,6 @@ import {
   NavigationInformation,
 } from './common'
 
-// TODO: implement navigation direction in listeners
-
 // const cs = console
 // const cs = consola.withTag('abstract')
 
@@ -55,6 +53,8 @@ export default function createMemoryHistory(): RouterHistory {
   const routerHistory: RouterHistory = {
     // rewritten by Object.defineProperty
     location: START,
+    // TODO: implement it
+    base: '/',
 
     replace(to) {
       const toNormalized = normalizeLocation(to)
index e4f7cccac7662efbbbe3bc1e6579e143a57156bd..a78f3e657d65ad793ca123811fd77077434be3b0 100644 (file)
@@ -76,7 +76,9 @@ export const START: HistoryLocationNormalized = {
 }
 
 export interface RouterHistory {
-  location: HistoryLocationNormalized
+  readonly base: string
+  readonly location: HistoryLocationNormalized
+
   push(to: RawHistoryLocation, data?: any): void
   replace(to: RawHistoryLocation): void
 
index a56b7fb67f92a17fc7ce54bce7e272e0ede735bc..c964c5bf76c465e9362a33ab328024dbfdc0943b 100644 (file)
@@ -90,8 +90,6 @@ export default function createHistory(): RouterHistory {
   // TODO: should it be a stack? a Dict. Check if the popstate listener
   // can trigger twice
   let pauseState: HistoryLocationNormalized | null = null
-  // TODO: should it be a stack? a Dict. Check if the popstate listener
-  // can trigger twice
 
   const popStateHandler: PopStateListener = ({
     state,
@@ -101,8 +99,6 @@ export default function createHistory(): RouterHistory {
     cs.info('popstate fired', state)
     cs.info('currentState', historyState)
 
-    // TODO: handle go(-2) and go(2) (skipping entries)
-
     const from = location
     const fromState = historyState
     const to = createCurrentLocation(window.location)
@@ -163,6 +159,8 @@ export default function createHistory(): RouterHistory {
   const routerHistory: RouterHistory = {
     // it's overriden right after
     location,
+    // TODO: implement it
+    base: '/',
 
     replace(to) {
       const normalized = normalizeLocation(to)