Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Created June 7, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topherPedersen/daae9e8a2fc33f078da6d528a71149cb to your computer and use it in GitHub Desktop.
Save topherPedersen/daae9e8a2fc33f078da6d528a71149cb to your computer and use it in GitHub Desktop.
Nested "Enums" in TypeScript
enum Foo {
A = "ActivityCode.Foo.A",
B = "ActivityCode.Foo.B",
C = "ActivityCode.Foo.C",
}
enum Bar {
A = "ActivityCode.Bar.A",
B = "ActivityCode.Bar.B",
C = "ActivityCode.Bar.C",
}
enum Baz {
A = "ActivityCode.Baz.A",
B = "ActivityCode.Baz.B",
C = "ActivityCode.Baz.C",
}
const ActivityCode = {
Foo,
Bar,
Baz,
};
console.log(ActivityCode.Foo.A);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment