Union types in TypeScript: modeling state | Dark Hacker News