Conversation
|
@gvergnaud What's your opinion about this feature? We need a way to catch both compile-time and runtime errors. Currently |
|
I'm still considering it, but I'm not sure what's the best option in terms of API complexity / typesafety yet. In the meantime, this work around doesn't seem too bad: try {
return match(...).with(...).exhaustive()
} catch (e) {
return defaultValue
} |
|
@gvergnaud it looks great imo. Are you ok with the breaking changes? Don't you prefer a backward-compatible change? EDIT: I wasn't aware that |
|
#253 was merged, adding an optional fallback function to |
I haven't done much open source, but I thought this might be a really useful function for me personally.
Here is a link to the issue that I opened