News for hackers. Stuff that matters.
Re:TypeScript: Control flow analysis for destructured discri... by tshaddox on Wednesday November 03, 2021 @04:50PM (#29100091)
I believe this will also obviate a common recommendation to not destructure when using React Query: https://tkdodo.eu/blog/react-query-and-type-script#type-narr...
Re:TypeScript: Control flow analysis for destructured discri... by dragosmocrii on Wednesday November 03, 2021 @04:55PM (#29100143)
Thanks for sharing this. I literally ran into the same issue yesterday, and was wondering why TS can't understand that I am discriminating on the isSucces property.
Re:TypeScript: Control flow analysis for destructured discri... by tkdodo on Friday November 05, 2021 @05:13PM (#29124804)
I’ll definitely update that article once the new TS version is released :)