question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deprecate iterable, asyncIterable

See original GitHub issue

Their 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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
conartist6commented, Feb 12, 2019

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.

0reactions
sithmelcommented, Apr 9, 2019

Removed them. I added some extra documentation about iterables and iterators

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found