Accessing Enum Values in TypeScript for Reuse
How can I access an Enum's values? I'd like to do something like this:
I'm open to alternative ways of doing this, too!
I'm open to alternative ways of doing this, too!
const TrafficLightState = S.enums({
Red: 0,
Yellow: 1,
Green: 2,
} as const);
const PedestrianLightState = S.enums({
Red: TrafficLightState.values.Red, //<- but there's no `values` prop
Green: TrafficLightState.values.Green,
} as const);