-
-
Save rlemon/e8fdcf0e3c2d898a4a92 to your computer and use it in GitHub Desktop.
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
foo(function(err, fres) { | |
var arr = []; | |
fres.forEach(function(item) { | |
bar(item, function(state) { | |
arr.push({ item: item, state: state }); | |
}); | |
}); | |
res.render(page, { arr: arr }); | |
// obviously arr is empty. | |
// how would I use promises to handle this? | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment