TypeScript - Discriminated Union
Channel: ProgramArtist
Date: 2017-07-08

In this episode I talk about the Discriminated Union in TypeScript.

00:29 Creating the discriminant typescript types
02:07 Creating a union type for the discriminant
02:23 Handling the union type using Type Guards
06:10 An example using Quokka
06:48 Figuring out why Quokka does not like me
07:58 The problem with adding another discriminant to the union
09:24 Solving the unhandled added discriminant
09:38 What is never type in TypeScript

You can see all the code here:
https://github.com/slavik57/typescript-playground

Learn TypeScript:
https://www.youtube.com/playlist?list=PLtm06noQc9vmfoC4U0w90HTIRzpVKeXlC

TypeScript - Type Guards:
https://youtu.be/S4ewVsq8JV0

TypeScript - Union, Intersection & String Literal Types:
https://youtu.be/IpP6xbkojy4