Created
September 14, 2018 08:57
-
-
Save richardprice-1990/1536e8fefbf343660fe0c1791e40b48d 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
// Old code | |
const findProtostarSubids = async (item, callback) => { | |
async.waterfall([ | |
(cb) => { | |
matchSubid(item) | |
.then((res) => { | |
cb(null, res); | |
}).catch((err) => { | |
cb(err) | |
}); | |
}, | |
], (err, result) => { | |
if (err) { | |
console.log(err) | |
} | |
callback(err, result); | |
}); | |
}; | |
// New code | |
const findProtostarSubids = async (item) => { | |
let results = await matchSubid(item).catch(e => { | |
throw (e) | |
}); | |
return (results); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment