this post was submitted on 15 Mar 2024
2 points (100.0% liked)

TypeScript

945 readers
1 users here now

founded 2 years ago
MODERATORS
 

Today I'm sharing a little trick that I like to use to make switch statements cleaner and more type-safe. Happy to hear other ideas!

top 1 comments
sorted by: hot top controversial new old

There is support for this in Effect as another implementation.

https://effect.website/docs/guides/style/pattern-matching