Skip to content

Instantly share code, notes, and snippets.

@dominykas
Created July 29, 2015 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominykas/7c200a9ff039f6945778 to your computer and use it in GitHub Desktop.
Save dominykas/7c200a9ff039f6945778 to your computer and use it in GitHub Desktop.
function processOneStuff(whateverFunction) {
return function (oneStuff, cb) {
whateverFunction(oneStuff, function (err, res) {
cb(err, res);
})
}
}
module.exports = function processManyStuffs(manyStuffs, someFunction, cb) {
async.map(manyStuffs, processOneStuff(someFunction), function (err, res) {
cb(err, res);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment