Skip to content

Commit 8782284

Browse files
authored
Merge pull request javascript-tutorial#367 from odsantos/update-en-blob
Update "Blob" article
2 parents 67d683f + eb22261 commit 8782284

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

4-binary/03-blob/article.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ For each URL generated by `URL.createObjectURL` the browser stores a URL -> `Blo
101101

102102
A generated URL (and hence the link with it) is only valid within the current document, while it's open. And it allows to reference the `Blob` in `<img>`, `<a>`, basically any other object that expects a URL.
103103

104-
There's a side-effect though. While there's a mapping for a `Blob`, the `Blob` itself resides in the memory. The browser can't free it.
104+
There's a side effect though. While there's a mapping for a `Blob`, the `Blob` itself resides in the memory. The browser can't free it.
105105

106106
The mapping is automatically cleared on document unload, so `Blob` objects are freed then. But if an app is long-living, then that doesn't happen soon.
107107

@@ -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)