Post

You don’t need to use a plain union you can still use a enum like object. With object as const. Something like this

💯 This pattern is much more flexible and consistent than enums. I hate how you can pass invalid numbers as a value for a param expecting a numeric enum, but you can't pass a valid string as a value for a string enum. I will shed no tears when enums are shelved alongside the likes of `with`