async-nocatch
Get rid of try/catch
wrappers for your async/await
functions.
Why?
- Unnecessary nesting
- Failure is not always an error but
try/catch
means handling error - You should always
catch
Installation
npm i async-nocatch # or yarn add async-nocatch
// For exampleconst nocatchFetch =
Before
try const result = await console catch error console
After
const success result = await if success console else console