rename preloadRoutes to prefetchRoutes

This commit is contained in:
Rich Harris
2018-03-04 22:38:55 -05:00
parent 2ad10b380f
commit 329c113723
3 changed files with 10 additions and 7 deletions

View File

@@ -266,7 +266,7 @@ export function goto(href: string, opts = { replaceState: false }) {
}
}
export function preloadRoutes(pathnames: string[]) {
export function prefetchRoutes(pathnames: string[]) {
if (!routes) throw new Error(`You must call init() first`);
return routes
@@ -281,4 +281,7 @@ export function preloadRoutes(pathnames: string[]) {
.reduce((promise: Promise<any>, route) => {
return promise.then(route.load);
}, Promise.resolve());
}
}
// remove this in 0.9
export { prefetchRoutes as preloadRoutes };