in-promise
v0.8.0
Published
A minimal Promise/A+ implementation for browsers
Downloads
5
Readme
in-promise is a minimal Promises/A+ implementation for browsers. ~700 bytes (gzip).
API
It is really minimal, and only provides a ES6 style Promise constructor plus a Promises/A+ compatible Promise#then
method:
var p1 = new Promise(function (res, rej) {
setTimeout(function () {
res('Hello Promise')
}, 100)
})
var p2 = p1.then(function (value) {
console.log(value) // Hello Promise
})
This is no Promise#catch
or Promise.all
or Promise.race
or ...
Just Promise#then
.
For a polyfill for ES6 Promise, check the es6 branch.