1.2.3 • Published 8 years ago

beauty-promise v1.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 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

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago