]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(router): rename onReady to isReady
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 31 Dec 2019 13:48:39 +0000 (14:48 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 31 Dec 2019 13:48:39 +0000 (14:48 +0100)
__tests__/matcher/path-parser.spec.ts
__tests__/ssr/shared.ts
src/router.ts

index dbcf90e69d0eba8e8896698d4d7b0da39e6a726a..aa27eed84271da0e42f5d7c93c5577495e2cec7d 100644 (file)
@@ -581,7 +581,7 @@ describe('Path parser', () => {
 
     // TODO: better syntax? like /a/{b-:param}+
     // also to allow repeatable because otherwise groups are meaningless
-    it('group+', () => {
+    it('groups (extract a part of the param)', () => {
       matchParams('/a/:a(?:b-([^/]+\\)?)', '/a/b-one', {
         a: 'one',
       })
index 9392cc5658c05e414292ac847530fa4c60f9ef32..7e5cd775c30c2e48c6856062e754bad312545b17 100644 (file)
@@ -61,8 +61,7 @@ export function renderApp(
     const { app, router } = createApp(routerOptions, vueOptions)
 
     // wait until router has resolved possible async components and hooks
-    // TODO: rename the promise one to isReady
-    router.onReady().then(() => {
+    router.isReady().then(() => {
       // const matchedComponents = router.getMatchedComponents()
       const matchedComponents = router.currentRoute.matched
       // no matched routes, reject with 404
index 8b7d9f0332a0220a821399ad0e24fe9e380437e7..4dabd2b712dfd0a8e7cca338834874e04f7e7939 100644 (file)
@@ -68,8 +68,7 @@ export interface Router {
 
   // TODO: also return a ListenerRemover
   onError(handler: ErrorHandler): void
-  // TODO: change to isReady
-  onReady(): Promise<void>
+  isReady(): Promise<void>
 }
 
 export function createRouter({
@@ -456,7 +455,7 @@ export function createRouter({
     markAsReady()
   }
 
-  function onReady(): Promise<void> {
+  function isReady(): Promise<void> {
     if (ready && currentRoute !== START_LOCATION_NORMALIZED)
       return Promise.resolve()
     return new Promise((resolve, reject) => {
@@ -563,7 +562,7 @@ export function createRouter({
     afterEach,
     createHref,
     onError,
-    onReady,
+    isReady,
 
     doInitialNavigation,
     setActiveApp,