Exploring Advanced TypeScript Concepts - Guards, Utility Functions, and More [Typescript Tutorial]

preview_player
Показать описание
Ready to gain more confidence with your TypeScript skills? If you're familiar with basic TypeScript functions and features, what can you do to take your Typescript skills to the next level?

Access the code and follow along here:

Segments:
00:00 - Intro
01:02 - TypeScript Guards
02:40 - TypeScript "in" Operator
03:57 - Type Predicates Scenario
04:58 - Type Predicates
09:40 - Assert Functions
12:33 - TypeScript Lookup Types
14:05 - TypeScript Generics
17:14 - Extract Utility Function
23:34 - Conditional Types
39:13 - Next Steps
41:03 - Material UI Brand Button Component Example
48:25 - Upcoming Events and Resources

TypeScript Handbook:

In this presentation, Kelsey Leftwich, Senior Developer at Headway, will help you explore some advanced TypeScript concepts such as utility functions and guards. If you're an adventurous JavaScript developer, you might find some value in this discussion too. Otherwise, it is the best fit for folks with some familiarity with TypeScript.

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

Access the code and follow along here:

Segments:
00:00 - Intro
01:02 - TypeScript Guards
02:40 - TypeScript "in" Operator
03:57 - Type Predicates Scenario
04:58 - Type Predicates
09:40 - Assert Functions
12:33 - TypeScript Lookup Types
14:05 - TypeScript Generics
17:14 - Extract Utility Function
23:34 - Conditional Types
39:13 - Next Steps
41:03 - Material UI Brand Button Component Example
48:25 - Upcoming Events and Resources

headwayio
Автор

Kind of a trivial point, regarding the `in` operator (which is actually a JS operator, not a TS operator): it's generally recommend to not use `in` as it will look through the whole prototype chain to find a key that matches.

E.g. 'toString' in ({a: 2}) // true

Better is to use ({a: // false

... or use a TS package like SimplyTyped which has a objectHasKey(obj, key) util

andrewpeters
Автор

This is my offering to the Youtube algorithm. May such videos and recommendations come up more on my homepage and other's. 🙋‍♀️
Excellent content

PrevalentAA
Автор

Learned a lot of new things from TS (infer, extract utility), very nice talk

FelipeIssa
Автор

Type predicates solved a problem I was working on while listening to this video, thank you!

JaredM
Автор

Thanks for the video. I never seen such advanced TS video like this.

mailtochung
Автор

Wow, Kelsey Leftwich, not exactly the person I expected to see leading a randomly recommended Typescript tutorial but awesome nonetheless. Congrats.

NoTengoIdeaGuey
Автор

the type predicates (input is Type) and __typename attribute in interfaces and types are really cool points. I'm starting a new project and hope situations where I can use these coding patterns come up.

ozzyfromspace
Автор

this is it! exactly what i was looking for

shid.account
Автор

Really nice explanation :) I'm going to share it to my colleague

babas_babas
Автор

Thank you Headway team, thank you Kalsey, thank you Jacob <3

mohammadalioruji
Автор

This is one of the times I want the video to be longer than it is.

sora-senpai
Автор

Thank you, great video and really easy to follow along :)

manuelcasares
Автор

Nice tutorial. I'm familiar with most of them, but she made me watch it all.

xrr-
Автор

Thank you for making this video, this really help me to practice typescript

parkerAmv
Автор

Most of people mispurpose usage of typescript, the general purpose is to help you, YOU, not the code, to better validate it. TypeScript compiles to JavaScript, in that proces all the types, interfaces are gone, so make sure you write it correctly and proper handle errors. Things presented at the beginning could done in shorter way, just by use Mapped Types, also throwing and error isn't wise, just use Generic Type instead of :any and make it return in priority if it get wrong type. Didnt watched past 11 min because amount of mistakes was too high.

sebek
Автор

For the type predicate, why do you even need it if you're just going to return a comparison inv.__type === "some type"? I am not sure what the value is for this scenario because it's not returning a type it's returning a bool so even a simple in-line if(inv.__type === "some type") would work too.

just curious.

lipslidemyrail
Автор

A nicer alternative to the Unarray imo is simply doing something like this -
`type Release = typeof backlog['releases'][number]`

abdulmateen
Автор

What does “deliminated” mean? Do you mean “delimited”?

TrackedHiker
Автор

great video. quality content on your channel. You deserve a million subscribers. Keep up the good work.

ogbillity