Lightweight implementation of promises

后端 未结 7 1546
独厮守ぢ
独厮守ぢ 2021-02-02 17:09

I am building a simple charting tool. When a user chooses a data source and a chart type, both the data and the script for the specific chart (.js) are loaded and then the code

7条回答
  •  被撕碎了的回忆
    2021-02-02 17:48

    I strongly suggest using an implementation of the Promises/A specification, which is becoming the standard way of doing promises in JavaScript. Promises work better when everyone uses the same flavor, so it's in everyone's interest to use compatible implementations.

    Q is probably the most popular and fully featured implementation (it also will adapt jQuery and other incompatible promises), while when and rsvp are supposed to be more "lightweight".

提交回复
热议问题