Skip to content

Instantly share code, notes, and snippets.

@seanstrom
Created January 20, 2015 05:52
Show Gist options
  • Save seanstrom/db0d9f675672fb7d6ecd to your computer and use it in GitHub Desktop.
Save seanstrom/db0d9f675672fb7d6ecd to your computer and use it in GitHub Desktop.
Async JS/Node - Parallel Callbacks Example - Part 2
// Part 2
function getTweetsPostsRepos(username, callback) {
// counter
getTweets(username, function(err, results) {
if(err) return callback(err)
somethingFinished(null, results)
})
getPosts(username, function(err, results) {
if(err) return callback(err)
somethingFinished(null, results)
})
getRepos(username, function(err, results) {
if(err) return callback(err)
somethingFinished(null, results)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment