3 ms·
yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people)
by dimitropoulos 3y ago
yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people)
- qudat 3y agoHi! Charles has a great article about why it's better to use generators over async/await: https://frontside.com/blog/2023-12-11-await-event-horizon/ https://frontside.com/blog/2023-12-11-await-event-horizon/ There are real benefits to using generators over async/await so I would encourage everyone to learn more about them and their benefits.
- cowboyd 3y ago> yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people) Just tell them that they already know them. `yield*` is - a superset of `await` so if you understand `await`, you understand `yield*` - infinitely more powerful because it can handle any effect, not just Promise resolution. - It's just javascript syntax that predates `await`