typescript-tips

mattpocockuk Matt Pocock ✈️ Modern Frontends (@mattpocockuk) - November 14, 2022 at 8:23 PM

πŸ”₯ TypeScript Tip πŸ”₯

Using union types can make your types more accurate, but each approach has pro’s and con’s.

Here, we compare a normal union, a discriminated union, and a type predicate. Which do you prefer? pic.twitter.com/5GWhRk6TlF

Tweet link