Open mxstbr opened 6 years ago
Wercker failed even though all tests passed 🤔
I came here to do this and was pleasantly surprised to find a PR already open. Now that async iterators are supported natively in node, this would definitely be nice to have, ideally without polyfill. Would it be possible to use the [Symbol.asyncIterator]
protocol so that it's possible to pass the cursor itself directly into the for-await-of loop?
Would it be possible to use the
[Symbol.asyncIterator]
protocol so that it's possible to pass the cursor itself directly into the for-await-of loop?
Already possible!
@neumino ?
See #370, this patch adds a
cursor.asyncIterator
method which returns an async iterator:I added
iterall
as a dependency since I need to use it in the tests anyway, but if you want me to I can move it to thedevDependencies
and inline the$$asyncIterator
polyfill snippet. (it's like 3 lines)