mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
implement this.fetch (#178)
This commit is contained in:
@@ -92,6 +92,8 @@ function prepare_route(Component: ComponentConstructor, data: RouteData) {
|
||||
}
|
||||
|
||||
return Promise.resolve(Component.preload.call({
|
||||
store,
|
||||
fetch: (url: string, opts?: any) => window.fetch(url, opts),
|
||||
redirect: (statusCode: number, location: string) => {
|
||||
redirect = { statusCode, location };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user