Hacker News new | ask | show | jobs
by x1000 3268 days ago
This article seems relevant, https://www.typescriptlang.org/docs/handbook/advanced-types.... . Particularly the part on discriminated unions. I'm just now learning TypeScript, so I have yet to actually implement anything this way.