We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 496a375 + 903d18a commit 27ef8f5Copy full SHA for 27ef8f5
1 file changed
index.js
@@ -13,8 +13,14 @@ function toReadable (iterator, opts) {
13
readable.destroy(err)
14
}
15
16
+ let curNext
17
async function next () {
- const { value, done } = await iterator.next()
18
+ if (curNext) {
19
+ await curNext
20
+ return
21
+ }
22
+ const { value, done } = await (curNext = iterator.next())
23
+ curNext = null
24
if (done) {
25
readable.push(null)
26
return
0 commit comments