Last active
January 30, 2018 02:03
-
-
Save garbles/ee9a70ab474de3bed83e092cbe796aff to your computer and use it in GitHub Desktop.
This file contains 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 uuid from 'uuid-v4'; | |
import {sample} from 'babel-plugin-transform-flow-to-gen/api'; | |
import type {$Gen} from 'babel-plugin-transform-flow-to-gen/Gen'; | |
// FYI, | |
// type $Gen<T, _U> = T; | |
type User = { | |
id: $Gen<string, uuid>, // $Gen only supports references to function calls | |
name: string | |
} | |
console.log(sampleOne(User())); | |
// { "id": "90d53f1a-c49c-4010-aeaa-68d52e56181f", "name": "pnxR" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment