Open svr93 opened 2 years ago
Flow has different methods helpful for enum usage: https://flow.org/en/docs/enums/using-enums/#toc-methods 1) cast 2) isValid
It will be wonderful to include some helpers with strict type safety in TS:
v = SomeEnum.cast(raw) // v type inference: SomeEnum | null
Yes, it's a useful feature but I'm worried about how ADT enums will work with those mehods.
Flow has different methods helpful for enum usage: https://flow.org/en/docs/enums/using-enums/#toc-methods 1) cast 2) isValid
It will be wonderful to include some helpers with strict type safety in TS: