Last active
October 9, 2018 13:01
-
-
Save dewey92/b081b1e39c53c06f728805304cf3e7eb to your computer and use it in GitHub Desktop.
Branding improvement
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 Brand<Name, Type> = Type & { _brand?: Name } // optional | |
| type Celcius = Brand<'Celcius', number>; | |
| type Fahrenheit = Brand<'Fahrenheit', number>; | |
| const fiveC: Celcius = 5; // typechecked :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment