DEV Community

Discussion on: Type-Safe Error Handling In TypeScript

Collapse
 
airtucha profile image
Alexey Tukalo

Great article, and great lib. Thank you for spreading the concept of monadic error handling. I was also playing with it recently. I followed PromiseLike interface with my approach so, that it is actually possible to use async/await. I will be happy to hear your thoughts about it - npmjs.com/package/amonad

Collapse
 
_gdelgado profile image
Gio

Hey Alexey,

Thanks for the kind words :)

Note that neverthrow implements a promisible interface as well.

See the ResultAsync docs here

Collapse
 
airtucha profile image
Alexey Tukalo

Oh, it looks cool! What is an advantage of having ResultAsync as a separate abstraction?

Thread Thread
 
_gdelgado profile image
Gio

You can think of Result as eagerly evaluated and ResultAsync as lazily evaluated. They're two entirely different mechanisms and thus can't be merged into a single abstraction.