This commit is contained in:
Skylar Grant 2025-01-04 10:45:23 -05:00
parent 3ae1c24e3c
commit 36c215b6f3

View File

@ -28,9 +28,9 @@ async function readResponse(response) {
try {
function read() {
// Recursive function to read the stream
reader.read().then(( done, value ) => {
console.log(`Done: ${JSON.stringify(done)}`);
console.log(`Value: ${new TextDecoder().decode(value)}`);
reader.read().then(( chunk ) => {
console.log(`Done: ${JSON.stringify(chunk.done)}`);
console.log(`Value: ${new TextDecoder().decode(chunk.value)}`);
if (done) {
return;
}