You left out combining the generators API with Symbol.iterator to create an object which can be used with the browser's native for/of syntax. developer.mozilla.org/en-US/docs/W... Which, from my perspective, is the most obvious/common use case for generators.
Separately, the open source recurring dates library rSchedule is built entirely upon ES6 generators. They are a necessary abstraction given that many calendar schedules are infinitely recurring.
Pretty much every object in the library is a generator. The generator code for the Rule object can be seen here: gitlab.com/john.carroll.p/rschedul....
When you build out a recurrence object in rSchedule, you are really building a generator out of many generators.
Didn’t leave out the Symbol.iterator ... was looking for “practical” use-cases. Can you show, in code, a use case beyond the Hello World examples?
For the rSchedule ... THAT is what I was looking for. Can’t wait to dig through their code!
I'll let rSchedule be my practical example.
I believe I might need to extend my definition of practical. I was looking for real-world use-cases since some of the examples seem challenging to see applied in production code. I’m trying to showcase code that is more than just an example.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.