implement this.fetch (#178)

This commit is contained in:
Rich Harris
2018-03-17 19:21:25 -04:00
parent cf6621b83c
commit 1e8d7d10ab
8 changed files with 116 additions and 1 deletions

View File

@@ -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 };
},