Last active
May 23, 2017 15:43
-
-
Save nucleartide/fd33398027b31fb9f5a49b15bb671b05 to your computer and use it in GitHub Desktop.
Flow comment types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| /* :: | |
| export type Hamster = { | |
| age: number, | |
| birthday: Date, | |
| } | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| // To run: | |
| // | |
| // $ yarn add --dev flow-bin | |
| // $ flow init | |
| // $ yarn run flow | |
| /* :: import type { Hamster } from './hamster' */ | |
| /** | |
| * Can also import type definitions if installed. | |
| * | |
| * :: import type { Middleware } from 'express' | |
| */ | |
| function test(n /*: number */) /*: Hamster */ { | |
| return n // will error | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment