Skip to content

Instantly share code, notes, and snippets.

@KoryNunn
Created May 29, 2018 04:59
Show Gist options
  • Save KoryNunn/444a8b9f4c2d0fef0ae051f0bf07149c to your computer and use it in GitHub Desktop.
Save KoryNunn/444a8b9f4c2d0fef0ae051f0bf07149c to your computer and use it in GitHub Desktop.
var things = righto(function(done){
//Something async
setTimeout(function(){
done(null, 1);
}, 100);
})
var stuff = righto(function(done){
//Something async
setTimeout(function(){
done(null, 2);
}, 100);
})
var whatsits = righto(function(things, stuff, done){
//Something async
setTimeout(function(){
done(null, things + stuff);
}, 100);
}, things, stuff)
var dooby = righto(function(things, done){
//Something async
setTimeout(function(){
done(null, things/2);
}, 100);
}, things)
var result = righto.mate(whatsits, dooby)
result(function(error, whatsits, dooby){
//Done
console.log(whatsits, dooby);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment