HackerTrans
トップ新着トレンドコメント過去質問紹介求人

GeZe

no profile record

投稿

TypeScript Enums vs. Flow Enums

medium.com
7 ポイント·投稿者 GeZe·5 年前·8 コメント

コメント

GeZe
·5 年前·議論
FYI, it would not be accurate to say that "The Flow people moved on to ReScript".
GeZe
·5 年前·議論
Another example would be the difference between their enum features: https://medium.com/flow-type/typescript-enums-vs-flow-enums-... "TypeScript Enums vs. Flow Enums"
GeZe
·5 年前·議論
Flow also supports "discriminated unions" [0], and did so before TypeScript (Flow's announcement in July 2015: https://flow.org/blog/2015/07/03/Disjoint-Unions/, TypeScript's announcement in August 2016: https://devblogs.microsoft.com/typescript/announcing-typescr...), though it doesn't yet support destructuring the "kind" field as was just added to TypeScript.

[0] https://flow.org/try/#0C4TwDgpgBAggxsAlgewHZQLwCgq6gHygG8oBr...
GeZe
·5 年前·議論
Here are the docs for exporting/importing enums: https://flow.org/en/docs/enums/using-enums/#toc-exporting-en... - works fine with the new export/import syntax.

Docs for enums compilation/runtime are here: https://flow.org/en/docs/enums/defining-enums/#toc-enums-at-...