Skip to content

Instantly share code, notes, and snippets.

@seanstrom
Created January 20, 2015 05:50
Show Gist options
  • Save seanstrom/d2656d4544cc3aaabe8f to your computer and use it in GitHub Desktop.
Save seanstrom/d2656d4544cc3aaabe8f to your computer and use it in GitHub Desktop.
Async JS/Node - Parallel Callbacks Example - Part 1
// Part 1
function getTweetsPostsRepos(username, callback) {
var count = 0
, results = []
function somethingFinished(err, result) {
count += 1
results.push(result)
if(count === 3) {
callback(null, results)
}
}
// more stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment