Skip to content

Instantly share code, notes, and snippets.

@nucleartide
Last active May 23, 2017 15:43
Show Gist options
  • Select an option

  • Save nucleartide/fd33398027b31fb9f5a49b15bb671b05 to your computer and use it in GitHub Desktop.

Select an option

Save nucleartide/fd33398027b31fb9f5a49b15bb671b05 to your computer and use it in GitHub Desktop.
Flow comment types
// @flow
/* ::
export type Hamster = {
age: number,
birthday: Date,
}
*/
// @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