GitHub

This repository was archived by the owner on Jul 30, 2022. It is now read-only.

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

Read the original on github.com ↗