35 lines
907 B
TypeScript
35 lines
907 B
TypeScript
|
// function httpGetter(): any {
|
||
|
// }
|
||
|
//
|
||
|
// httpGetter().prototype.get = (filename: string) => new Promise((whohoo, doh) => {
|
||
|
// const xhr = new XMLHttpRequest();
|
||
|
// xhr.addEventListener('load', (e) => {
|
||
|
// if (xhr.status === 200) {
|
||
|
// whohoo(xhr.responseText);
|
||
|
// return;
|
||
|
// }
|
||
|
// doh('failed with status ' + xhr.status + ': ' + xhr.statusText);
|
||
|
// });
|
||
|
// xhr.open('GET', filename);
|
||
|
// xhr.send();
|
||
|
// });
|
||
|
//
|
||
|
// class HttpGetter {
|
||
|
// async get(filename: string): Promise<any> {
|
||
|
// const xhr = new XMLHttpRequest();
|
||
|
// xhr.addEventListener('load', (e) => {
|
||
|
// if (xhr.status === 200) {
|
||
|
// // whohoo(xhr.responseText);
|
||
|
// return;
|
||
|
// }
|
||
|
// // doh('failed with status ' + xhr.status + ': ' + xhr.statusText);
|
||
|
// });
|
||
|
// xhr.open('GET', filename);
|
||
|
// xhr.send();
|
||
|
// }
|
||
|
// }
|
||
|
// export {
|
||
|
// httpGetter,
|
||
|
// HttpGetter
|
||
|
// };
|