Skip to content

Instantly share code, notes, and snippets.

@richardprice-1990
Created September 14, 2018 08:57
Show Gist options
  • Save richardprice-1990/1536e8fefbf343660fe0c1791e40b48d to your computer and use it in GitHub Desktop.
Save richardprice-1990/1536e8fefbf343660fe0c1791e40b48d to your computer and use it in GitHub Desktop.
// 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