|
|
|
|
|
by qudat
1053 days ago
|
|
I get asked this question a lot — I help maintain redux-saga. I recently gave a talk where this question came up: https://youtu.be/uRbqLGj_6mI?t=2166 I’ve also imposed generators on a lot of colleagues. I think they are mostly misunderstood and potentially in the realm of being “magical” — at least on the surface. The reality is they are syntactic sugar on top of functions with recursive switch statements where each case is a yield point. They aren’t that hard to grok — the syntax is mind bending. Having code that looks synchronous but behaves asynchronous is “magical.” I think it does come down to that because everyone loves async/await even tho that’s just sugar on generators where each yield must be a promise. |
|