mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
rename preloadRoutes to prefetchRoutes
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user