- 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.
- Developing Mobile Web ArcGIS Applications
- Python自然語言處理(微課版)
- Cassandra Data Modeling and Analysis
- Learn React with TypeScript 3
- Mathematica Data Analysis
- Unity&VR游戲美術設計實戰
- C語言程序設計習題與實驗指導
- Django實戰:Python Web典型模塊與項目開發
- Mastering SciPy
- Building a Media Center with Raspberry Pi
- 讓Python遇上Office:從編程入門到自動化辦公實踐
- Python實戰指南:手把手教你掌握300個精彩案例
- Neo4j權威指南 (圖數據庫技術叢書)
- 像程序員一樣使用MySQL
- Python AI游戲編程入門:基于Pygame和PyTorch