Created
January 20, 2015 05:50
-
-
Save seanstrom/d2656d4544cc3aaabe8f to your computer and use it in GitHub Desktop.
Async JS/Node - Parallel Callbacks Example - Part 1
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
// 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