I recently discovered your channel, and I really enjoyed watching this series. So I just wanted to specify that it could be clearer for Warning/Error type guard to use "object" type instead of "unknown", this type preserving us from primitive types. Thanks for your awesome work!
Hey, thanks for the feedback! I could’ve done a better job explaining why I used “unknown” there, so let me try to do that now haha: I don’t like the idea of having a guard that can throw for whatever reason. Refer to Lodash’s guards for example, none of them throw, they always give you true or false. For that reason, I have this convention with my team to always use “unknown” for guard parameters. It’s really not that big of a deal once you get used to it, and it avoids unexpected runtime errors 😅
🚨 Join the waiting list for my ✨Web Animations Course✨ to get a discount when the course launches: www.lucaspaganini.com/web-animations
very good and comprehensive explanation. thank you!
Glad it was helpful!
Really clear and good explanation of type predicates. Very high quality videos in general. Suscribed !
Thanks for the support Salvador! 🙂
Muy valiosa informacion, el video perfectamente explicado, gracias! saludos desde colombia!
Thank you!! Saudações do Brasil! :)
I'm learning TypeScript using FullStackOpen and unfortunetly I get lost with the explination. This was really helpful!
I totally understand the feeling, I always study a topic from multiple sources to really get it 😅
Bravissimo! Grazie.
Thanksss 🙂
I recently discovered your channel, and I really enjoyed watching this series.
So I just wanted to specify that it could be clearer for Warning/Error type guard to use "object" type instead of "unknown", this type preserving us from primitive types.
Thanks for your awesome work!
Hey, thanks for the feedback! I could’ve done a better job explaining why I used “unknown” there, so let me try to do that now haha:
I don’t like the idea of having a guard that can throw for whatever reason. Refer to Lodash’s guards for example, none of them throw, they always give you true or false.
For that reason, I have this convention with my team to always use “unknown” for guard parameters.
It’s really not that big of a deal once you get used to it, and it avoids unexpected runtime errors 😅
даже то, как сделано описание под видео, профессионально. Супер
Part 4 released!! 🔥 th-cam.com/video/o0v7lJF11Pg/w-d-xo.html
100th like :D
That's awesome!!!