summaryrefslogtreecommitdiff
path: root/fetch.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-27 12:49:33 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-27 12:49:33 -0400
commitc21ae406af9706053c1b39426cdb0aba091145f4 (patch)
treefac62fc6a54fbc6d9574b2e4735550a8ecfb6992 /fetch.ts
parent4e55928063b4f3378d2e9425c551ce0288ca39a2 (diff)
Clean up in fetch.ts
Diffstat (limited to 'fetch.ts')
-rw-r--r--fetch.ts15
1 files changed, 2 insertions, 13 deletions
diff --git a/fetch.ts b/fetch.ts
index dac019048..71920d176 100644
--- a/fetch.ts
+++ b/fetch.ts
@@ -55,9 +55,8 @@ class FetchResponse implements Response {
async text(): Promise<string> {
const ab = await this.arrayBuffer();
- const enc = new TextDecoder("utf-8");
- // Maybe new Uint8Array(ab)
- return enc.decode(ab);
+ const decoder = new TextDecoder("utf-8");
+ return decoder.decode(ab);
}
get ok(): boolean {
@@ -139,13 +138,3 @@ export function fetch(
fetchReq.start();
});
}
-
-/*
-fetch('http://example.com/movies.json')
- .then(function(response) {
- return response.json();
- })
- .then(function(myJson) {
- console.log(myJson);
- });
- */