deprecate iterable, asyncIterable
See original GitHub issueTheir only purpose seems to be converting an object like:
{
next: () => {}
}
to an iterable. I don’t think they are particularly useful, given that if you already manage to have that, you can probably add:
{
next: () => {},
[Symbol.iterator]: function () {
return this
}
}
Also the name doesn’t really tell you what they do.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Symbol.asyncIterator - JavaScript - MDN Web Docs
The Symbol.asyncIterator well-known symbol specifies the default async iterator for an object. If this property is set on an object, ...
Read more >Diving into JavaScript's Async Iterables | by Kevin B. Greene
For example the values on an async iterable may come from a user action or from data consumed from a WebSocket , or...
Read more >iterable.return() is not sufficient to clean up subscriptions #143
But keep in mind: no AsyncIterable s anyone is using for GraphQL subscriptions should do ... asyncIterable method and deprecate pubsub.
Read more >Difference between `AsyncIterable[T]` and `Iterable[Awaitable ...
One big issue you're missing is how the end of the loop is handled. An asynchronous iterator's __anext__ returns an awaitable, ...
Read more >async-iterable-iterator/async-iterator-to-array - npm package
Learn more about @async-iterable-iterator/async-iterator-to-array: package health score, popularity, security, maintenance, versions and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I certainly hope that the methods aren’t/wouldn’t be used much, but it also seems like a pretty elementary operation. The core design of iterables creates two separate concepts. Iterators and iterables are a fundamental part of the system, not just a mistake that will be papered over eventually. Given that anyone who understands how these concepts work together should understand what this function does, I don’t think we should probably keep it. We could however clean up the documentation, and more actively direct people to just make their iterators iterables instead using these methods.
Removed them. I added some extra documentation about iterables and iterators