JavaScript design patterns #2. Factories and their implementation in TypeScript | Hacker News Reader