Created
December 2, 2014 16:35
-
-
Save ralphtheninja/c003f2592eeb7ceaa869 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
function synchCallback(opts, cb) { | |
if (!opts.someImportantProperty) return cb(new Error('Missing important property')) | |
doSomeStuff(opts, function(err, result) { | |
console.log(err, result) | |
// .. | |
cb(err, result) | |
}) | |
} | |
synchCallback({}, function(err, results) { | |
// this callback will be called here, before '*' | |
}) | |
// '*' | |
console.log('this will be called after the callback above') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment