Skip to content

Instantly share code, notes, and snippets.

@AhsanAyaz
Created September 6, 2019 07:16
Show Gist options
  • Save AhsanAyaz/4aee813e12285ee296e3580395a418a4 to your computer and use it in GitHub Desktop.
Save AhsanAyaz/4aee813e12285ee296e3580395a418a4 to your computer and use it in GitHub Desktop.
Understanding Discriminated Unions in Typescript
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