Open vojtatranta opened 8 years ago
We are using Generators because it's great construct which allows us nicely yield
side effects within functions while hypothetically maintaining their purity. Even Redux attempted to utilize something similar https://github.com/reactjs/redux/issues/1528
We haven't encountered any problems while using Generators. It does have a drawback though, you can't yield
effects within callbacks unless you explicitly provide yield*
in the Functor. So for example traditional map
with yield
will not work.
Generators are actually pretty mature, they successfully made it into ES2015 and therefore will get natively supported in browsers soon.
Why do you use generators if they compile into while loops? Is it not too early to use them? Have you encountered any troubles with that?