Created
April 16, 2018 08:04
-
-
Save smagch/8be2f24ade32f0366363b811e4cc2534 to your computer and use it in GitHub Desktop.
Flow Action Key
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
// @flow | |
type Action = | |
| { type: 'FOO' } | |
| { type: 'BAR' }; | |
type ActionKeys = $PropertyType<Action, 'type'>; | |
const fooType: ActionKeys = 'FOO'; | |
const barType: ActionKeys = 'BAR'; | |
const invalidType: ActionKeys = 'ffsdlkfjdaslfj'; // Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment