- Mastering JavaScript Promises
- Muzzamil Hussain
- 193字
- 2021-07-16 13:46:51
Considerations while choosing a promise
Before you start working with a promise library, there are a number of elements you should keep in mind. Not all the implementations of a promise's implementation are created equally. They are different from one another in terms of offered utilities by API, performance, and sometimes, behavior too.
A promise/proposal just outlines the proposed behavior of the promises and not implementation specifications. This results in varying libraries offering a different set of features. These are the ways that they differ from one another:
- All promises/compliments have
then()
; function and also have varying features in their API. In addition to this, they're still able to exchange promises with each other. - In promise/compliant libraries, a thrown exception is translated into a rejection and the
errorHandler()
method is called with the exception.
As a result of the differing implementations, there are interoperability problems when working with libraries that return or expect promise/compliant.
There may be trade-offs in choosing a promise library. Every library has its own pros and cons, and it is purely up to you to decide what to use depending on the particular use case and your project needs.
- Intel Galileo Essentials
- jQuery從入門到精通 (軟件開發視頻大講堂)
- Mastering Ext JS
- C語言程序設計同步訓練與上機指導(第三版)
- 區塊鏈底層設計Java實戰
- HTML5秘籍(第2版)
- Android項目實戰:手機安全衛士開發案例解析
- 人人都能開發RPA機器人:UiPath從入門到實戰
- Python預測之美:數據分析與算法實戰(雙色)
- Mastering Apache Camel
- Modular Programming with JavaScript
- C# 7.0本質論
- jQuery Mobile Web Development Essentials(Second Edition)
- Backbone.js Patterns and Best Practices
- Learning ROS for Robotics Programming