In this TypeScript tutorial, you will learn how to encapsulate your data-fetching functionality in a generator function. This approach will enhance the reusability of your code, as consuming code can simply use for-await to fetch the data.
My FREE programming apps:
https://apps.apple.com/app/id659282498
https://play.google.com/store/apps/de...
My FREE TypeScript Course:
https://typescript.tv/
Timeline:
00:00 - Intro
00:31 - Fetching Data with Async-Await
05:52 - Turning Functions into Generator Functions
09:56 - The Benefits of Generator Functions
11:01 - Bonus: Converting JSON Data into a Zod Schema
Resources:
https://polygon.io/stocks
https://transform.tools/json-to-zod
#typescript #javascript #nodejs