Another ES6 promise implementation (compliant with Promises/A+)
npm install @kilt/paroleAnother ES6 promise implementation (compliant with Promises/A+)




.sh
npm install parole --savealternatively you can use bower (minified version by default)
bower install parole --save
`$3
> Parole implements ES6 Promise specs` js
// parole respects the es6 promise specification
// you can use parole as global polyfillif( !window.Promise ) {
window.Promise = Parole;
}
`$3
` js
new Parole(function (resolve, reject) {
resolve('gogogo!');
}) .then(function (result) {
console.log('checkpoint 1', result);
throw 'whoops!';
})
.then(function (result) {
console.log('checkpoint 2', result);
},function (result) {
console.log('checkpoint 2.1', result);
return new Parole(function (resolve, reject) {
setTimeout(function () { resolve('all right!'); }, 400);
});
})
.then(function (result) {
console.log('checkpoint 3', result);
}, function (reason) {
console.log('checkpoint 3.1', reason);
})
;
`
> output`.sh
checkpoint 1 gogogo!
checkpoint 2.1 whoops!
elapsed 400ms
checkpoint 3 all right!
`$3
` sh
make test
``