Spent sometime to complete the document of my rust Result like library `unwrapit` for JS/TS.
Still think this might be a proper way to deal with errors in JS/TS
Still think this might be a proper way to deal with errors in JS/TS
Here’s lots of typical exception handling patterns: http://wiki.c2.com/?ExceptionPatterns
Persobally I prefer exceptions over boilerplate “if’s”, but good to know that there’s a wrapper for the people who don’t.
There's a lot of more established and battle tested libraries with the same functionality - I've recently been using Purify and finding it to be absolutely fine :)
their version of the same feature is here: https://gigobyte.github.io/purify/adts/Maybe
https://github.com/musicq/unwrapit/blob/d5c437a235ad1f5ad042...