Required: TypeScript built-in mapped type with a real world use case

preview_player
Показать описание
Here we look at TypeScript's built in mapped type called Required.

🚥 Professional Courses

Smash that like and subscribe for more content like this ❤️

👇 SUBSCRIBE for MORE 👇

**Feel Free To Read This Lot**

I'm Basarat, That TypeScript Guy and I love helping developers. More about me:

Microsoft MVP for TypeScript
150K contributions on Stackoverflow. Top Contributor for TypeScript.
Book Author : Beginning NodeJS
Book Author : TypeScript Deep Dive
Creator of multiple hot ✨ed Github Open Source projects

Рекомендации по теме
Комментарии
Автор

I was just facing the same issues now. having to pull null checks all over the place even when knowing the value is going to be there in some part. This tip came to the rescue at just the right time!

ishant
Автор

Is there an easy way to do the same for some of the fields of interface but not the whole? E.g. { a?: string, b?: string } and i want only a to be required. And everything else untouched.

ishant