Last active
March 13, 2017 03:09
-
-
Save garbles/d5c147e3a02505ffd8d8a27aeb251f88 to your computer and use it in GitHub Desktop.
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
import {sampleOne} from 'babel-plugin-transform-flow-to-gen/api'; | |
import type {Developer, JavaScript} from './types'; | |
const javaScriptDevGen = Developer(JavaScript()); | |
const dev = sampleOne(javaScriptDevGen); | |
console.log(dev); | |
// { name: 't', age: 4, preferredLanguage: { name: 'javascript' } } |
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
export type Developer<T> = { | |
name: string, | |
age: number, | |
preferredLanguage: T | |
}; | |
export type JavaScript = { | |
name: 'javascript' | |
}; | |
export type Ruby = { | |
name: 'ruby' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment