From c21ae406af9706053c1b39426cdb0aba091145f4 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 27 May 2018 12:49:33 -0400 Subject: [PATCH] Clean up in fetch.ts --- fetch.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fetch.ts b/fetch.ts index dac019048f..71920d1762 100644 --- a/fetch.ts +++ b/fetch.ts @@ -55,9 +55,8 @@ class FetchResponse implements Response { async text(): Promise { 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); - }); - */