?
This commit is contained in:
parent
3ae1c24e3c
commit
36c215b6f3
@ -28,9 +28,9 @@ async function readResponse(response) {
|
|||||||
try {
|
try {
|
||||||
function read() {
|
function read() {
|
||||||
// Recursive function to read the stream
|
// Recursive function to read the stream
|
||||||
reader.read().then(( done, value ) => {
|
reader.read().then(( chunk ) => {
|
||||||
console.log(`Done: ${JSON.stringify(done)}`);
|
console.log(`Done: ${JSON.stringify(chunk.done)}`);
|
||||||
console.log(`Value: ${new TextDecoder().decode(value)}`);
|
console.log(`Value: ${new TextDecoder().decode(chunk.value)}`);
|
||||||
if (done) {
|
if (done) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user