Re:Pattern Matching Custom Data Types in TypeScript
by alexsasharegan on Saturday February 02, 2019 @04:31PM
(#19065851)
This might be our best hope right now: https://github.com/tc39/proposal-pattern-matching
[ Parent
| on HN ]
Re:Pattern Matching Custom Data Types in TypeScript
by Klathmon on Saturday February 02, 2019 @07:13PM
(#19066817)
I see a lot of people asking for this in TS, but i'd much rather it be in plain JS and let TS add anything on top of it that is needed.
Pattern matching would work SO WELL in javascript, especially considering how frequently switch is currently poorly used as a replacement in things like Redux.