Async Await Primer/Review (TypeScript)

preview_player
Показать описание
Just a quick run through on async/await actual use in TypeScript.
Sorry about the missing mouse cursor.
Рекомендации по теме
Комментарии
Автор

Very cool demo. I have been teaching my team that it is essentially writing asynchronous code as though it was synchronous. The huge benefit is maintenance. Someone supporting your code, even if it is yourself, will be able to understand it much easier.

greghibbard
Автор

Great video and explanation of async/await!
I've been using Promises for quite some time (for almost 2 years, since Node supported it for a very long time) to avoid the callback hell. To be honest, I was somehow satisfied with the look of the code, though sometimes, with a lot of Promise chains, you could end up with 10 to 15 _then_ blocks in your code, which made it a little bit unmanageable (even if you use function reference instead of defining a function inside the then block).
I've been transitioning to TypeScrip, mainly due to the Angular 2 on the client; even though I've been playing with it on the back-end for some time and I really liked it.
Async/await just made me rethink of the whole concept of writing async code!
I think I'm going to play with it and hopefully rewrite some of my asynchronous code, starting on some smaller projects first and see how it behaves.

ognjenjevremovic
Автор

thank you for this video it helped, i think i need to get my hands dirty to fully understand it, i totally understand how promises work, but async/await is just weird for me.

azero