Created
January 16, 2022 18:07
-
-
Save jasonbyrne/b40f4fa81b53bd16b18272ad342e3f35 to your computer and use it in GitHub Desktop.
Generic Value Wrapper
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
| class WrappedValue<T> { | |
| constructor( | |
| public name: string, | |
| public value: T | |
| ) {} | |
| } | |
| const data: WrappedValue[] = [ | |
| new WrappedValue<string>("First Name", "Jason"), | |
| new WrappedValue<string>("Last Name", "Byrne"), | |
| new WrappedValue<number>("Age", 40), | |
| new WrappedValue<boolean>("Vaccinated?", true), | |
| ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment