|
|
|
|
|
by yen223
703 days ago
|
|
Yeah, one of the annoyances I have with using Enums, even in other languages, is that its serialised value isn't always obvious. Something like direction.NORTH could serialise into "NORTH" or some integer, depending on the language and the implementation. I like Typescript's union of string literals approach because its serialised value is never in question. I know exactly what "NORTH" serialises to. |
|