3 ms·
Thanks, I didn't think of that, it's a little more work and error prone with functions and else/if code and less aesthetic than the switch/case that works with
by hokkos 11y ago
Thanks, I didn't think of that, it's a little more work and error prone with functions and else/if code and less aesthetic than the switch/case that works with Flow, but I might restart my typing goal knowing that.
- Matthias247 11y agoYeah, the if/else cascades that you need when there are lots of cases are definitly not on the most elegant side. But maybe some support for type guards in combination with switch/case will follow. In can live with the current situation, because it isn't really better in most other programming languages without sum types (you mostly need some instanceof followed by a type cast).