Skip to content

Instantly share code, notes, and snippets.

@JoeStanton
Last active October 2, 2016 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeStanton/759f75bdb7fe61fbbe12c2ff50166ff6 to your computer and use it in GitHub Desktop.
Save JoeStanton/759f75bdb7fe61fbbe12c2ff50166ff6 to your computer and use it in GitHub Desktop.
Flow Runtime Types
type Suit =
| "Diamonds"
| "Clubs"
| "Hearts"
| "Spades";
// Babel transformed into Flow AST:
export const SuitType = {
type: 'UnionTypeAnnotation',
types:
[ { type: 'StringLiteralTypeAnnotation', value: 'Diamonds' },
{ type: 'StringLiteralTypeAnnotation', value: 'Clubs' },
{ type: 'StringLiteralTypeAnnotation', value: 'Hearts' },
{ type: 'StringLiteralTypeAnnotation', value: 'Spades' } ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment