Skip to content

Commit f780e1f

Browse files
Editorial: document ReadableStream.from(asyncIterable)
1 parent 8d7a0bf commit f780e1f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

index.bs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ urlPrefix: https://tc39.es/ecma262/; spec: ECMASCRIPT
3636
text: %Object.prototype%; url: #sec-properties-of-the-object-prototype-object
3737
type: dfn
3838
text: abstract operation; url: #sec-algorithm-conventions-abstract-operations
39+
text: array; url: #sec-array-objects
40+
text: async generator; url: #sec-asyncgenerator-objects
41+
text: async iterable; url: #sec-asynciterable-interface
3942
text: completion record; url: #sec-completion-record-specification-type
4043
text: internal slot; url: #sec-object-internal-methods-and-internal-slots
44+
text: iterable; url: #sec-iterable-interface
4145
text: realm; url: #sec-code-realms
4246
text: the current Realm; url: #current-realm
4347
text: the typed array constructors table; url: #table-49
@@ -694,6 +698,14 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission
694698
[[#qs-api]]. If it is not provided, the default behavior will be the same as a
695699
{{CountQueuingStrategy}} with a [=high water mark=] of 1.
696700

701+
<dt><code><var ignore>stream</var> = {{ReadableStream/from(asyncIterable)|ReadableStream.from}}(<var ignore>asyncIterable</var>)</code>
702+
<dd>
703+
<p>Creates a new {{ReadableStream}} wrapping the provided [=iterable=] or [=async iterable=].
704+
705+
<p>This can be used to adapt various kinds of objects into a [=readable stream=], such as an
706+
[=array=], an [=async generator=], or a <a
707+
href="https://nodejs.org/api/stream.html#class-streamreadable">Node.js readable stream</a>.
708+
697709
<dt><code><var ignore>isLocked</var> = <var ignore>stream</var>.{{ReadableStream/locked}}</code>
698710
<dd>
699711
<p>Returns whether or not the readable stream is [=locked to a reader=].

0 commit comments

Comments
 (0)