y-resolver
v11.0.1
Published
A backwards compatible extension to the Promises/A+ spec
Downloads
149
Readme
Resolver
Sample usage
var Resolver = require('y-resolver'),
res = new Resolver(),
yd = res.yielded;
setTimeout(function(){
res.accept('hi');
});
if(!yd.done) yd.listen(function(){
if(this.accepted) console.log(this.value); // hi
else throw this.error;
});
yd.then(function(value){
console.log(value); // hi
});