Follow

I *really* want Result and Option in JS tbh

· · Web · 1 · 0 · 2
@joepie91 I have ended up making my own Result type in TypeScript so that I can have what are effectively checked exceptions. It's pretty neat https://github.com/Gnuxie/matrix-protection-suite/blob/main/src/Interface/Action.ts#L14C1-L52. You also can't pass the type checker with program that would attempt to access the result unless it also checks for and handles the failed version 😌

What do you see as the benefit in pure JS?
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.