A note on TypeScript discrimination unionsRecently I started using discrimination unions a lot in typescript. This technique allows us to write more type-safe codes, for instance: in…Jan 11, 2024