- Mastering JavaScript Promises
- Muzzamil Hussain
- 153字
- 2021-07-16 13:46:49
Callback, revisited
In previous chapters, you learned how the JavaScript mechanism works. The single-threaded model of JavaScript has its limitation, which can be controlled through better use of callbacks. However, the scenarios such as callback hell really pushed engineers to find and implement a better way to control the callbacks and maximize the performance of the program, while staying inside a single thread. A callback is a function that can be passed as an argument to another function to be executed when it's called.
There is absolutely no harm in using callbacks, but there are also a number of other options available to handle asynchronous events. Promise is one such way to handle asynchronous events and has more efficiency than many of other asynchronous tools in its family.
To understand more clearly why we needed to implement Promises.js in asynchronous programming, we need to understand the concept behind the promise and deferred objects.
- Java范例大全
- Java入門經典(第6版)
- 數據結構與算法JavaScript描述
- 區塊鏈:以太坊DApp開發實戰
- Mastering Yii
- The DevOps 2.4 Toolkit
- 深入淺出RxJS
- Flutter跨平臺開發入門與實戰
- Express Web Application Development
- Android驅動開發權威指南
- Building Serverless Web Applications
- 分布式數據庫原理、架構與實踐
- Building Business Websites with Squarespace 7(Second Edition)
- .NET 4.0面向對象編程漫談:應用篇
- AMP:Building Accelerated Mobile Pages