1.2.3 • Published 7 years ago

beauty-promise v1.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Promise

Implementation of javascript Promise/A+ standard, plus .finally and onUnhandledRejection.

Nothing more. Clean and tiny (4.5 KB Only).

Use it by: npm install all-promise, or include browser-bundles/promise.min.js.

Promise API

Constructor
new Promise(fn: function(resolve, reject))
Promise Instance Methods
promise.then(onFulfilled: null|function(value), onRejected: null|function(reason))
promise.catch(onRejected: function(reason))
promise.finally(onRejected: function(valueOrReason))
Static Methods
Promise.resolve(value: *)
Promise.reject(reason: *)
Promise.all(promises: Array.<Promise | Thenable>)
Promise.race(promises: Array.<Promise | Thenable>)
Unhandled Promise Rejection
Promise.onUnhandledRejection = function (reason) {
    // ... handle your unhandled rejection
};
1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago