franeklubi / rustic

rustic is a TypeScript library providing emulation of Rust's Option and Result types (and some useful wrappers for common js functions as well!)

Home Page:https://www.npmjs.com/package/rustic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

catchResult for promises

kiranpradeep opened this issue · comments

In most other similar libraries for option/result, we don't similar type inferencing. I like that for Option, once inside if() we can directly use the variable. Similar for Result, once inside isOk() check, type inference is active. awesome job.

This is not an issue, only a request. Currently, catchResult can only be used with functions. Can it be extended to Promises ?