Did you know that JavaScript Promises evaluate eagerly? Meaning as soon as you create them, they instantiate their async functionality, whether you like it or not. Sometimes this is OK. Other times, you may want something that's a little more lazy. In this video, we'll show you how to extend the Promise class to make your own lazy-evaluating Promises that won't do any work until you actually ask them to.
Links:
Promise - developer.mozilla.org/en-US/d...
Watch Austin's Livestreams here:
RU-vid: / heyaustingil
Twitch: / heyaustingil
Website: austingil.com/
Chapters:
0:00 - Introduction
0:13 - Create Lazy Promises in JavaScript
3:38 - Wrap Up & Conclusion
#promise #webdevelopment #javascript
11 июл 2024