A promise can be:
- Fulfilled, the action relating to the promise exceeded.
- Rejected, the action relating to promise failed.
- Pending, hasn’t been fulfilled or rejected yet.
- Settled, has fulfilled or rejected
The promise object represents the eventual completion or failure of an operation and its returning/resulting value. Promises can be like event listeners but a promise can only succeed or fail once. So when you grab something with a promise you are not really worried about the time it became available, your just worried about the outcome and what you want to do with it.
Promises can be in libraries such as:
- RSVP JS
Here is a chart better explaining the above:
History of Promises.
Implementations of promises appeared in languages such as Multi Cisp and Concurrent prolog in the early 1980s. Also in the beginning of 2011 promise concepts were made popular by JQuery Defferred Objects. Deferred objects are similar to promises. In 2012 they were proposed to specs to standardize how many authors were using promises. They brought more attention for promises, one of the reasons they became so popular.
The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting…
Imagine that you're a top singer, and fans ask day and night for your upcoming single. To get some relief, you promise…
Promises simplify deferred and asynchronous computations. A promise represents an operation that hasn't completed yet…