y-resolver

A backwards compatible extension to the Promises/A+ spec

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
y-resolver
0011.0.17 years ago9 years agoMinified + gzip package size for y-resolver in KB

Readme

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
});