Axel Rauschmayer on Nostr: #TypeScript: I’m writing a blog post about enums and alternatives. As it turns out, ...
#TypeScript: I’m writing a blog post about enums and alternatives. As it turns out, my previous thinking was too complicated. Things become relatively simple if you consider 3 use cases:
1. Namespace for constants with primitive values
2. Custom type with unique values
3. Namespace for constants with object values
Per use case, these are desirable features:
* Exhaustiveness checks
* Members can be enumerated
1. Namespace for constants with primitive values
2. Custom type with unique values
3. Namespace for constants with object values
Per use case, these are desirable features:
* Exhaustiveness checks
* Members can be enumerated