Union types in TypeScript: modeling state | Hacker News Reader