Mapped Types - Advanced TypeScript

preview_player
Показать описание
In this video I'll explain how to create and use Mapped Types in TypeScript.

00:28 A simple example
02:59 Create a new type based on an existing object type literal (using keyof to get properties of a type)
05:14 Recreating the Pick type
07:19 Explaining how mapped type is used by Record type
09:05 Difference between an interface with an index signature and the Record type
11:12 How to add a specific property to a mapped type?

👨‍💻 My Udemy Course:
Using TypeScript with React
Рекомендации по теме
Комментарии
Автор

This is the one of the best explanations regarding advanced typescript concepts No one likes you explain this on YouTube ever thanks a lot sir.

anuragrai
Автор

Чудове, послідовне пояснення!) Дякую!) Підписався на канал :)

mykyta-maria
Автор

Thank you for these! Great teacher and hacker! Understanding the composability of Typescript is key to writing less of it

samelie
Автор

Wow! Speechless... Your tutorial is a work of art that is crafted to perfection. Thank you for taking the time and sharing your talent with the world.

renisoncrawford
Автор

Keep it up! Pretty good content! Thanks for taking the time to record those videos!

pragmaticivan
Автор

Man your videos are on another level. Fews videos on this channel are so advance, that I need to watch several times..

imsarvesh_
Автор

Excellent work. Ran into Records for exactly the limitation of [key: ?]. I don't have a lot of use cases for the generality of keys, so I worked around it and forgot that it bugged me! Thanks for the deeper dive.

inaccessiblecardinal
Автор

Being pointed to useful typing declarations sure saves a lot of time compared to digging through the entire Typescript documentation, thanks :3

vaylinne
Автор

I like how you are teaching. Very clear...
Thank you

YonathanBenitah
Автор

You are very clear in your thoughts and so as conveying it to others. Great content with easy explanation. Thank you!

shahid
Автор

Thanks mate, excellent tutorial. Instantly subscribed.

borasumer
Автор

Nice and very good to understand. Finally I have the chance to get into TypeScript magic...

TheAUa
Автор

Thanks for the explanation. Great video overall :o.

SimonProductionsTM
Автор

Thank you Dimitrii. Only now I had on a project @ts-ignore statement and could overcome it with your Mapping Types Solution. Really it made the code look so nice and persistent now. Awesome!

andreicristea
Автор

Thank you for making this! I've learned so much. Can you please do a deep dive into Generics? What you can and can't do with them, interfaces with generic member functions and such? I'm really struggling getting things to work and I can't find videos going deep into them.

casual_sky
Автор

Дякую, Дмитре!
В кінці (12:09), через посилання на 2 інші відео зовсім не видно що коїться на екрані.

maksym
Автор

Damn is this stuff useful. Great explanation!

SuperQuwertz
Автор

Is there any way we can do reverse of it …?

harshtiwari
Автор

Like, share, subscribe!
Awesome! Thanks for explanation!

mikhailkh
Автор

Mapped Types - это всё ещё самая непонятная для меня тема. Я просто не понимаю как начать думать конвенцией Typescript, чтобы также жонглировать дженериками.
Вот например даже на видео есть запись вида <K extends keyof any, T>, но какие ключи могут быть у "any"? "Any" может же быть чем угодно, хоть числом, у числа нет ключей, но typescript почему то не ругается. Всё это только сбивает и сеет смуту в мою голову.

Или вот ещё пример. На видео 7:03 мы говорим, что "a" - это keyof "T", но "T" имеет в себе ещё и "b". Почему Typescript не ругается на отсутствие "b" - мне тоже неведомо. И в процессе я наблюдаю кучу таких вот вещей и нюансов. Надеюсь когда-нибудь я осознаю дух машины Тайпскрипта и посмотрю с недоразумением на прошлую версию самого себя.

gerda-morozova