Created
September 6, 2019 07:16
-
-
Save AhsanAyaz/4aee813e12285ee296e3580395a418a4 to your computer and use it in GitHub Desktop.
Understanding Discriminated Unions in Typescript
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
interface IBicycle { | |
vType: "bicycle"; | |
make: number; | |
} | |
type Vehicle = IMotorcycle | ICar | ITruck | IBicycle; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment