Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmdartus/generators-for-fun
https://github.com/pmdartus/generators-for-fun
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmdartus/generators-for-fun
- Owner: pmdartus
- Created: 2023-09-11T08:49:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-11T08:49:26.000Z (about 1 year ago)
- Last Synced: 2024-10-18T19:01:21.082Z (28 days ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Generators implements the iterator protocol in JavaScript.
It's a mix between an iterator and a function.
Execution is paused until `.next()` is invoked.It looks a lot like an `async` function, reads like a function that execute synchronously. But requires the invoker to request the next value to advance into the execution.
Observable or EventEmitter ==> Push new values to consumers.
Iterator or Generator ==> Consumer pull new values.`Array.from` is same performance that `for ... of` in the benchmark.