Discriminated unions in TypeScript: Modeling state without bugs | Mahamudul Hasan Rubel