Created
May 29, 2018 04:59
-
-
Save KoryNunn/444a8b9f4c2d0fef0ae051f0bf07149c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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