Skip to content

Commit add4491

Browse files
committed
resolve comments
1 parent 03ab818 commit add4491

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

5-network/03-fetch-progress/article.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ while(true) {
2929
}
3030
```
3131

32-
نتیجه‌ی فراخوانی `await reader.read()` یک شیء با دو ویژگی است:
33-
34-
* ویژگی **`done`** -- زمانی `true` می‌شود که خواندن کامل شده باشد، در غیر این صورت `false` است.
35-
* ویژگی **`value`** -- یک آرایه تایپ‌شده از بایت‌ها: `Uint8Array`.
32+
نتیجه‌ی فراخوانی `await reader.read()` یک شیء با دو ویژگی است:
33+
* ویژگی **`done`** -- زمانی `true` می‌شود که خواندن کامل شده باشد، در غیر این صورت `false` است.
34+
* ویژگی **`value`** -- یک آرایه تایپ‌شده از بایت‌ها: `Uint8Array`.
3635

3736
```smart
3837
توجه: Streams API همچنین پیمایش ناهمزمان (`async iteration`) روی `ReadableStream` را با حلقه‌ی `for await..of` تعریف می‌کند، اما هنوز به طور گسترده پشتیبانی نمی‌شود (به [مشکلات مرورگرها](https://github.com/whatwg/streams/issues/778#issuecomment-461341033) مراجعه کنید)، بنابراین از حلقه‌ی `while` استفاده می‌کنیم.
@@ -54,9 +53,8 @@ const reader = response.body.getReader();
5453
const contentLength = +response.headers.get('Content-Length');
5554

5655
// مرحله 3: خواندن داده
57-
let receivedLength = 0; // تا این لحظه این مقدار بایت دریافت شده
58-
let chunks = []; // آرایه‌ای از تکه‌های باینری دریافت‌شده (بدنه)
59-
56+
let receivedLength = 0; // تا این لحظه این مقدار بایت دریافت شده
57+
let chunks = []; // آرایه‌ای از تکه‌های باینری دریافت‌شده (بدنه)
6058
while(true) {
6159
const {done, value} = await reader.read();
6260

0 commit comments

Comments
 (0)