Created
July 31, 2020 11:53
-
-
Save corocoto/b8a91b3ce18fe7e8e5e393c63ec57145 to your computer and use it in GitHub Desktop.
Flow | Generic
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
| type GenericObject<T> = { key: T }; | |
| var numberT: GenericObject<number> = { key: 123 }; | |
| var stringT: GenericObject<string> = { key: "Preethi" }; | |
| var arrayT: GenericObject<Array<number>> = { key: [1, 2, 3] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment