DEV Community

Discussion on: Callback Hell and How to Rescue it ?

Collapse
mukuljainx profile image
Mukul Jain

Nice article, check this out npmjs.com/package/await-handler
Using this we can skip the try catch block and handle error there it self. Like in case you want to show different error message for different errors, one way to go.

    let [err, result] = await on(myAsyncTask());
Enter fullscreen mode Exit fullscreen mode
Collapse
jerrycode06 profile image
Nikhil Upadhyay Author

Nice, Thanks for sharing this!!