Created
April 11, 2015 19:54
-
-
Save IPRIT/21013d5ead0707b7eace to your computer and use it in GitHub Desktop.
This file contains hidden or 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 loadUsers(userIds, load, done) { | |
| var completed = 0; | |
| var users = []; | |
| userIds.forEach(function(id, index) { | |
| load(id, function(user) { | |
| users[index] = user; | |
| if (++completed === userIds.length) | |
| return done(users); | |
| }) | |
| }) | |
| } | |
| module.exports = loadUsers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment