Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TS2.4 String enum type #215

Closed
appsforartists opened this issue May 2, 2017 · 0 comments
Closed

Use TS2.4 String enum type #215

appsforartists opened this issue May 2, 2017 · 0 comments

Comments

@appsforartists
Copy link
Member

appsforartists commented May 2, 2017

In #155, we abandoned TS enums because their values are hard to debug. microsoft/TypeScript#15486 adds support for string values in enums. When TS2.4 ships, we should port all constant dicts to enums:

enum Axis = {
  X = 'x',
  Y = 'y',
  BOTH = 'both',
}

This also requires going through all places those constants are used and fixing the type, e.g.

axis: PropertyObservable<string> 
// becomes
axis: PropertyObservable<Axis>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant