Skip to content

Instantly share code, notes, and snippets.

@drumnickydrum
Last active December 30, 2022 21:26
Show Gist options
  • Save drumnickydrum/f24920def9cb42ce702500b2902e41ac to your computer and use it in GitHub Desktop.
Save drumnickydrum/f24920def9cb42ce702500b2902e41ac to your computer and use it in GitHub Desktop.
[TS: enum -> pojo] Use a pojo instead of an enum #typescript #enum
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