Описание тега promise
In computer science, future, promise, and delay refer to constructs used for synchronizing in some concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of its value is yet incomplete.
Promises are a common construct in javascript with new built in language support. There are several popular implementations of the concept such as bluebird and q. However, promises are not unique in JavaScript and similar patterns exist in many languages. Popular implementations exist in python, objective-c, c++, javascript, scala, dart, c# and most other languages. Some languages provide native language support for the construct.
Recurring questions:
- How do I convert an existing callback API to promises?
- /questions/3045126/kakovyi-razlichiya-mezhdu-otlozhennyim-obeschaniem-i-buduschim-v-javascript
- Aren't promises just callbacks?
- Promises in AngularJS and where to use them?
- How is a Promise library implemented?
- How do clojure promises and futures differ?
- Why are callbacks more 'tightly coupled' than promises?
Reading material:
- https://en.wikipedia.org/wiki/Futures_and_promises
- You're missing the point of promises - an introduction to promises.
- What are promises and why should I use them discusses the advantages of promises.
- Why I am switching to promises - analysis of performance of promises and other patterns.
- The promise Promises/A+ specification.
- What is the deferred antipattern? - a verbose, error prone, but all too common way to use promises
Popular Implementations:
- Bluebird - Bluebird is a full featured promise library with unmatched performance.
- Q - A tool for making and composing asynchronous promises in JavaScript
- Promise - A promise library that closely follows the ES6 spec with a few extensions for node.js
- When - A solid, fast Promises/A+ and when() implementation, plus other async goodies.
- RSVP - A lightweight library that provides tools for organizing asynchronous code
- Promises in npm