Last active
December 30, 2022 21:26
-
-
Save drumnickydrum/f24920def9cb42ce702500b2902e41ac to your computer and use it in GitHub Desktop.
[TS: enum -> pojo] Use a pojo instead of an enum #typescript #enum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SomeEnum = { | |
SomeValue: 'SomeValue', | |
SomeOtherValue: 'SomeOtherValue' | |
} as const; | |
type SomeEnumKey = keyof typeof SomeEnum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment