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.
This commit is contained in:
Amir Hasanzade 2022-05-16 03:12:20 -07:00 committed by GitHub
parent 2901e0c645
commit 38f5cad3e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,8 +237,8 @@ const readableStream = blob.stream();
const stream = readableStream.getReader(); const stream = readableStream.getReader();
while (true) { while (true) {
// for each iteration: data is the next blob fragment // for each iteration: value is the next blob fragment
let { done, data } = await stream.read(); let { done, value } = await stream.read();
if (done) { if (done) {
// no more data in the stream // no more data in the stream
console.log('all blob processed.'); console.log('all blob processed.');
@ -246,7 +246,7 @@ while (true) {
} }
// do something with the data portion we've just read from the blob // do something with the data portion we've just read from the blob
console.log(data); console.log(value);
} }
``` ```