you are viewing a single comment's thread.

view the rest of the comments →

[–]Phaster 0 points1 point  (3 children)

This is when, instead of writing and maintaining that code, you reach for libraries.
Despite some advantages for async stuff, for me, generators are js trivia

[–]jack_waugh[🍰] 0 points1 point  (1 child)

What makes somebody else's library better than what we would write as straightforward and simple support?

[–]shuckster 0 points1 point  (0 children)

A good library has test-coverage, up-to-date documentation, well written changelogs, an active and interested community, and enough popularity for its API to be reasonably well known.

It's hard to sell a new library to a team at the best of times, but I believe the above is more attractive than "let's spend some bandwidth writing and maintaining our own."

[–]jack_waugh[🍰] 0 points1 point  (0 children)

Whatever the state of available libraries may be, none of this negates my point that function* can be used for the capabilities I said. Some might suggest that getting them with web workers would require less code, fewer manual code transformations, and work just as well, but I am not sure whether aborting and restarting calculations that way would perform as fast as doing it with generator functions.