No BS TS #9 - Typescript Utility Types

preview_player
Показать описание
Lets take our first, but definitely not last look at Utility types in Typescript. Including Partial, Required, Pick, Record, and Omit.

00:00 Introduction
00:22 Utility types page
00:49 Project setup
03:30 Partial
04:40 Required
05:16 Pick
06:36 Record
08:55 Omit
10:30 Types from fields
11:20 Outroduction

👉 What's my theme? Night Wolf [dark blue]
👉 What's that font? MonoLisa

💢 Watch our other videos:

Thank you for watching this video, click the "SUBSCRIBE" button to stay connected with this channel.

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

Absolutely the best channel for TS I have came across, well done

viganzeqiri
Автор

I just realized I really don’t know the difference between a interface and a type (“type alias”). I did a quick look up and was reminded that A big difference is that interfaces can inherit, and types can’t. Other than that they seem to be fairly similar. I would appreciate a video from you discussing the topic!

DedicatedManagers
Автор

i dont know how you do it.. but you make programming so effortlessly easy yo watch..

francisfuwaku
Автор

Delicious channel! TS documentation isnt helping much, when you are new in Ts, but this channel is saving me every day!

fypek
Автор

Another stella lunch and learn TS video for me. Love the way you build the simple world solution and state that as the "problem" and then introduce a cool TS feature which solves it. Great stuff!

francis_n
Автор

Nice one again, Jack. I need to find some use cases for some of them you show here. Will have a look on the docs for more utils. Pick and Omit are the ones I have used several times before

victorlongon
Автор

Jack...you know your stuff. Thanks for sharing.

SuricataFpv
Автор

Just something I discovered playing around.

Once you destructured `v` with `const { id, ...other } = v` there is not longer a need to use `Omit<MyUser, "id">` as `id` is now gone from `v`.

bryonwicklund
Автор

This is crazy quality content, you deserve 1M+ subs, cheers

codewithmarwan
Автор

You're the Chuck Norris of TypeScript

sumitwadhwa
Автор

fantastic, Thanks a lot.!! I'll try to sponsor you on my first paylisp. I just joined new company recently and its second job after a break of 1 year.

SahilRajput
Автор

A brief and concise detailing loved it! your examples were great also i'm curious to know how did you do it like zoom that intellisense window while hover that was nice. Although it was all informative will check all your videos

pankajkotwani
Автор

for people using vim keybindings in vscode you can 'gh' since ctrl+k doesn't seem to work unless you're focusing outside the editor. it's the same as hovering with the mouse

TheTenThousandThings
Автор

Also you can "nest" utility types, like: Pick and make them Partial at the same time.

ramonmata
Автор

The algorithm is surging through my veins.

zykoz
Автор

Haha, "It's not really breaking, but it should be breaking..."

jornejongsma
Автор

7:18 I think using the reduce method isn't preferred. It can copy the entire "a" object every single time in this loop and results in a n^2 runtime. A simple for...of loop would be the better option.

mct
Автор

Great series so far, I am learning a ton. Question though: What utility would I use if I want a specific optional property to be required, without changing any other properties?

Cyranth
Автор

Hi everyone, which way is the safest to convert one type to another with the possibility to change property type if you want.
For example in the original one id: number in mapped type I am expecting to be able to set id: string. Thank you!

adiscivgin
Автор

At 9:26 why didn’t you get a compile error when you were using omit, but still returned the id as part of the record value object? You are returning the wrong type if the id is in there, aren’t you?

DedicatedManagers