We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey,
v3.0 doesn't bring async/await support for eachSeries yet? Is there a full list, which async functions now support Promise?
Expected with this update:
async.eachSeries(items, async (item, callback) => { const itemStats = await someFunc(item); callback(); });
Currently in usage:
async.eachSeries(items, (item, callback) => { (async () => { const itemStats = await someFunc(item); callback(); })(); });
The text was updated successfully, but these errors were encountered:
Async doesn't pass callbacks to async functions. Simply return!
async
return
async.eachSeries(items, async (item) => { const itemStats = await someFunc(item); });
Sorry, something went wrong.
Sorry, my question wasn't that good.
Without callback() i'm not able to handle the error after:
async.eachSeries(items, async (item) => { const itemStats = await someFunc(item); if(!itemStats) throw new Error('no stats found'); }, (err) => { if(err) return res.status(500); return res.status(200).json({success: true}) });
This won't work without callback or?
The idiomatic way to handle this with async/await would be:
await
try { await async.eachSeries(items, async (item) => { const itemStats = await someFunc(item); if(!itemStats) throw new Error('no stats found'); }) } catch (err) { return res.status(500); } return res.status(200).json({success: true})
No branches or pull requests
Hey,
v3.0 doesn't bring async/await support for eachSeries yet? Is there a full list, which async functions now support Promise?
Expected with this update:
Currently in usage:
The text was updated successfully, but these errors were encountered: