Re: [whatwg/streams] Rewrite to use Web IDL, and generally modernize (#1035)

@MattiasBuelens commented on this pull request.

Incredible, the spec text for async iteration is actually readable now, instead of being littered with prototype voodoo magic. 😅 

I'm also a big fan of `.values({ preventCancel })` as a replacement for `.getIterator({ preventCancel })`. 👍 

> @@ -892,7 +896,70 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission
  </div>
 </div>
 
-<!-- TODO async iterator stuff -->
+<h4 id="rs-asynciterator" oldids="rs-asynciterator-prototype,
+default-reader-asynciterator-prototype-internal-slots">Asynchronous iteration</h4>
+
+<dl class="domintro">
+ <dt><code>for await (const <var ignore>chunk</var> of <var ignore>stream</var>) { ... }</code>
+ <dt><code>for await (const <var ignore>chunk</var> of <var ignore>stream</var>.values([{ {{ReadableStreamIteratorOptions/preventCancel}} }])) { ... }</code>

I think the square brackets are a typo? You should be able to call this as `.values({ preventCancel })`, correct?
```suggestion
 <dt><code>for await (const <var ignore>chunk</var> of <var ignore>stream</var>.values({ {{ReadableStreamIteratorOptions/preventCancel}} })) { ... }</code>
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1035#pullrequestreview-398445921

Received on Wednesday, 22 April 2020 18:10:31 UTC