DEV Community

Discussion on: Say goodbye Trycatch Hell

Collapse
 
laurentperroteau profile image
Laurent Perroteau

Another exemple : await-to-js that returns the error first to enforce it to be handled :

const [error, result] = await to(getList());

if (error) ...
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ivanzm123 profile image
Ivan Zaldivar

I like, but is not necessary why is Typescript being used (as long as the developer uses static typing)

Collapse
 
hilleer profile image
Daniel Hillmann • Edited

Was about to point out it all seemed a bit like re-inventing the wheel, considering modules like this already exist.

I personally use and like await-to-js for many use cases.