Created
February 27, 2016 22:56
-
-
Save MylesBorins/dc913f250a5556353eb5 to your computer and use it in GitHub Desktop.
async
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 fs = require('fs'); | |
function readSomething(path, cb) { | |
if (typeof path !== 'string') { | |
return process.nextTick(function () { | |
return cb('I should be second'); | |
}); | |
} | |
fs.readFile(path, cb); | |
} | |
readSomething({}, function (err, data) { | |
if (err) { | |
return console.log(err); | |
} | |
}); | |
console.log('I should be first') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment