This commit is contained in:
Ilya Kantor 2019-03-20 15:52:26 +03:00
parent b716980d1b
commit 3fea520546
3 changed files with 0 additions and 33512 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,31 +0,0 @@
<!doctype html>
<script>
async function init() {
const response = await fetch('long.txt');
const reader = response.body.getReader();
const contentLength = +response.headers.get('Content-Length');
let receivedLength = 0;
while(true) {
const chunk = await reader.read();
if (chunk.done) {
console.log("done!");
break;
}
receivedLength += chunk.value.length;
console.log(`${receivedLength}/${contentLength} received`)
}
let result = await response.text();
console.log(result);
//const chunkCount = await read(reader);
//console.log(`Finished! Received ${chunkCount} chunks.`);
}
init();
</script>

File diff suppressed because it is too large Load diff