Re:Why Would Anyone Need JavaScript Generator Functions?
by myvoiceismypass on Monday November 07, 2022 @11:41AM
(#33508218)
Typescript supports exhaustive switches which are pretty powerful, especially when working with proper union types and the like.
[ Parent
| on HN ]
Re:Why Would Anyone Need JavaScript Generator Functions?
by adam_arthur on Monday November 07, 2022 @12:41PM
(#33509213)
I find using objects mapped as switchKeyToFunction to be more idiomatic and readable. e.g. shapeToDrawFn[shape] But to each their own