Skip to content

Instantly share code, notes, and snippets.

@nikolovlazar
Last active October 14, 2016 18:23
Show Gist options
  • Save nikolovlazar/1ecfcc005bb35e947f5913e27149d238 to your computer and use it in GitHub Desktop.
Save nikolovlazar/1ecfcc005bb35e947f5913e27149d238 to your computer and use it in GitHub Desktop.
TypeScript String Enums (or any type at all)
enum Screens {
Splash = <any>"Splash",
Login = <any>"Login",
Dashboard = <any>"Dashboard",
Settings = <any>"Settings",
Friends = <any>"Friends"
}
console.log(Screens.Splash) // => Splash
console.log(Screens.Login) // => Login
console.log(Screens.Dashboard) // => Dashboard
console.log(Screens.Settings) // => Settings
console.log(Screens.Friends) // => Friends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment