How does ts-reset work?
HTML-код
- Опубликовано: 19 мар 2023
- @mattpocockuk's new library ts-reset improves TypeScript's built-in types ... but how does it work? In this video, we'll take a look at the code and see what's going on.
github.com/total-typescript/t...
Blog: shaky.sh - Наука
Not going to lie, ts-reset is first library that I understood the inner workings of because Matt is so good at explaining everything about TypeScript.
You and Matt are the best TS teachers on the internet :D
A lot of content on RUclips consistently touches on the basics of typescript, so if you know how to annotate your code, there’s not a lot more to go on out there. Your content is a breath of fresh air. It’s not “if I type it as string, you’re now a typescript expert”. There’s far more realism and real-world issues in your content and I echo that of Matt’s channel.
That means a lot to me, thanks!
Very very cool library! Unfortunately, Typescript doesn't yet provide a type for NaN literals (not a number), even though NaN is also a falsy value, so when filtering out NaN from an array, it doesn't take NaN as a falsy value at a type level. NaN values propagate through the application at runtime the same way the any type does during development, making it very difficult to debug and find where a particular NaN came from. The same occurs when attempting to properly type ± Infinity as a literal type. I hope it get fixed soon..
Matt Pocock really cool)
NonFalsy seemed to have overlooked document.all. However, if this oversight matters to anyone, mercy be upon their souls.
I've learnt most of the things about Typescript from you, you're the Typescript Wizard for me 🧙♂. But still Matt's content are great too 😊
Bald is best
Aboot