// 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',
})
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
// TODO: also return a ListenerRemover
onError(handler: ErrorHandler): void
- // TODO: change to isReady
- onReady(): Promise<void>
+ isReady(): Promise<void>
}
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) => {
afterEach,
createHref,
onError,
- onReady,
+ isReady,
doInitialNavigation,
setActiveApp,