Async code can be some of the hardest code to write in Typescript and Javascript, and we write it all the time. So let’s build up some patterns for writing async/await code well, doing multiple stacked async calls, testing our async code, using promises for caching, and even supporting old school callbacks.
Code:
PokeAPI: #docker-and-compose--
Promise pool: @supercharge/promise-pool
MSDN Promises documentation:
00:00 Introduction
00:32 Project setup
02:31 Promises with then
04:55 Error handling with catch
06:30 Promises with async/await
08:55 Error handling with try/catch
12:15 Making your
... own promi ...
#JackHerrington #async_await_javascript #async_await_typescript #async_code #async_typescript #error_handling_patterns_in_async_code #jack_herrington #javascript_async #javascript_async_await #javascript_promises
20210901
VcOMq3LQtBUShow more