mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Beginning server-side rendering support
This commit is contained in:
13
samples/react/MusicStore/ReactApp/tracked-fetch.ts
Normal file
13
samples/react/MusicStore/ReactApp/tracked-fetch.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import isomorphicFetch from 'isomorphic-fetch';
|
||||
import { addTask } from './domain-tasks';
|
||||
|
||||
export function fetch(url: string): Promise<any> {
|
||||
// TODO: Find some way to supply the base URL via domain context
|
||||
var promise = isomorphicFetch('http://localhost:5000' + url, {
|
||||
headers: {
|
||||
Connection: 'keep-alive'
|
||||
}
|
||||
});
|
||||
addTask(promise);
|
||||
return promise;
|
||||
}
|
||||
Reference in New Issue
Block a user