There are few standards as per a promise/proposal, which has to be fulfilled for the true implementation of the concept. These standards are the keys to implement promises, and any library/language must comply with it for true implementation.
A promise does the following:
A promise returns an eventual value when a single completion of an operation occurs.
A promise has three states: unfulfilled (when a promise is waiting to be processed), fulfilled (when a promise has been completed and the desired result has been obtained), and finally, failed (when the result of a promise was obtained but not as anticipated).
Promise has a
then
property, which must be a function and must return a promise. In order to complete a promise,fulfilledHandler
,errorHandler
, andprogressHandler
must be called in.With a promise, callback handlers return the fulfillment value from the returned promise.
The promise value must be persistent. This should maintain a state, and within...