Created
August 6, 2019 21:34
-
-
Save Jexordexan/381ca15915c7c7b8d0c4dbbe183d90c7 to your computer and use it in GitHub Desktop.
Medium: Prop function
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
type PropType = String | Boolean | Number | Object | typeof Array | |
function prop<T = any>(type: PropType, options: any = {}): T { | |
return { type, ...options } as any | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment