Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 1.4 KB

README.md

File metadata and controls

19 lines (13 loc) · 1.4 KB

@codecb/iterator

🌡 An implementation of the Iterator helpers proposal.

Note: This implementation does not strictly follow the proposal. It creates a new base class and works on interfaces (Iterator, AsyncIterator, Iterable, and AsyncIterable) rather than inheriting from the real, native %IteratorPrototype% object which is quite awkward to access.

The interesting aspect of this project is it uses Generator and AsyncGenerator which makes it super easy to handle iteration operations comparing to writing a next function ourselves.

See test cases to have a taste of what these helpers do and how to use them.

References

  1. [GitHub] tc39/proposal-iterator-helpers
  2. [tc39.es] Iterator Helpers
  3. [2ality] ECMAScript proposal: iterator helpers
  4. [GitHub] nvie/itertools.js
  5. [GitHub] more-itertools/more-itertools
  6. [Rust] Trait std::iter::Iterator
  7. [Python] itertools — Functions creating iterators for efficient looping