With one tiny utility function we’ll unlock the full power of generators to make them work well with Promises and thus be the perfect weapon for asynchronous flows in our apps.
Fantastic course! Short and easy to watch / understand with a morning coffee. The last lesson enlightened me a lot — finally I understand the inner logic of async / await functions which in my eyes are essentially a combination of promises and generators. Thanks a ton for this course, looking forward for more your resources! Have a great day.
Thank you for the kind words, glad you enjoyed it 😊
How does a comparison between generators and observables look like?
The videos were informative. I'm wondering however, in your last video where you use generators and Promises together to fetch some data, wouldn't it be much simpler to just use Promises in that fetchQuote generator (or rather, fetchQuote function)?
I fail to see what the generator+Promises adds in this case. Perhaps you were just trying to give an idea of the capabilities but used a not so stellar example.
A Promise-based implementation of
fetchQuote() would consist of a chain of
.then() calls. While there is nothing wrong with that, using
yield instead allows you to write code that looks almost like a synchronous version of
fetch() is synchronous and picture the body of
fetchQuote() without the
THIS IS AMAZING!
good course last lesson could be done with await and it would work, it would be good if you would incorporate side effect on yields to show why this could be better used.
redux-saga for examples provides great use cases for generators.
Doesn't async await make this no longer very useful?
@Austin In did, but even now there are some enterprises and system codes still writing like.