You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add syntactic sugar to string enum declarations to infer their values from their key names. The overwhelming majority of string enum values are identical or near-identical to their key names, and it's kludgy to list every reserved value twice in its declaration.
enum<string> Foo {
A,
B,
...,
Y = 'LegacyOverrideYValue',
Z,
LongAndSimilarEnumName,
LongUnsimilarEnumName,
}
// instead of
enum Foo {
A = 'A',
B = 'B',
...,
Y = 'LegacyOverrideYValue',
Z = 'Z',
LongAndSimilarEnumName = 'LongAndSimilarEnumName',
LongUnsimilarEnumName = 'LongUnSimilarEnumName',
}
// which contains a sneaky bug
The text was updated successfully, but these errors were encountered:
Search Terms
string enum
default value
initializer
infer
Suggestion
Add syntactic sugar to string enum declarations to infer their values from their key names. The overwhelming majority of string enum values are identical or near-identical to their key names, and it's kludgy to list every reserved value twice in its declaration.
The text was updated successfully, but these errors were encountered: