Skip to content

Commit 38f5cad

Browse files
Update about.md (change "data" field to "value")
The object returned from "await stream.read()" has two fields: "done" and "value", and not the "data" field destructured here.
1 parent 2901e0c commit 38f5cad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

4-binary/03-blob/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ const readableStream = blob.stream();
237237
const stream = readableStream.getReader();
238238

239239
while (true) {
240-
// for each iteration: data is the next blob fragment
241-
let { done, data } = await stream.read();
240+
// for each iteration: value is the next blob fragment
241+
let { done, value } = await stream.read();
242242
if (done) {
243243
// no more data in the stream
244244
console.log('all blob processed.');
245245
break;
246246
}
247247

248248
// do something with the data portion we've just read from the blob
249-
console.log(data);
249+
console.log(value);
250250
}
251251
```
252252

0 commit comments

Comments
 (0)