Тёмный

This taught me so much about advanced TypeScript 

Joshua Morony
Подписаться 73 тыс.
Просмотров 10 тыс.
50% 1

My Angular course: angularstart.com/
It feels like there are two different worlds of TypeScript, and more advanced TypeScript can look completely incomprehensible - even if you've been using TypeScript for a long time. This video walks through typing a simple utility from an Angular library, and highlights some advanced TypeScript concepts that might not be as scary as they first seem.
signalSlice source code: github.com/nartc/ngxtension-p...
More on signalSlice: • I tried to build my dr...
Get weekly content and tips exclusive to my newsletter: mobirony.ck.page/4a331b9076
Want to build mobile apps with Angular?: ionicstart.com
#typescript #angular
0:00 Introduction
0:36 The Initial API
1:49 The Untyped API
2:06 Generic for initialState
2:55 Typing reducers
4:57 Typing selectors
5:16 The return type
7:55 Conclusion
- More tutorials: modernangular.com
- Follow me on Twitter: / joshuamorony

Опубликовано:

 

30 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@JoshuaMorony
@JoshuaMorony 5 месяцев назад
Next newsletter goes out tomorrow, join here: mobirony.ck.page/4a331b9076
@shaylevinzon540
@shaylevinzon540 5 месяцев назад
Amazing stuff, really well thought, and you made the state slice feel super intuitive and having signals making it super easy to adapt to changes. 🎉
@ayoubalfurjani4531
@ayoubalfurjani4531 5 месяцев назад
I certainly like this type of videos, please make some like this one from time to time.
@reggiedu
@reggiedu 5 месяцев назад
I'm enjoying the signalSlices so far. Also thanks for adding the lazySources so promptly after my github issue!
@JoshuaMorony
@JoshuaMorony 5 месяцев назад
No problem, it was a good suggestion!
@ahmedAltariqi
@ahmedAltariqi 3 месяца назад
This is literally my very favorite "advanced TypeScript " video ❤
@akam9919
@akam9919 2 месяца назад
I'm making a library myself. It is way harder than it seems. With regular app dev, you just have to make stuff that works, and if it looks cool, GREAT! With a library, achiveing correctness is a thousand times more difficult because you need your stuff to be way more well defined AND provide a good DX because, after all, developers are your customers. This forces you to consider things you never would have.
@agd99
@agd99 5 месяцев назад
What is the use for your signalSlice function? That’s what I have been trying to figure out for the whole video lol
@davidntumba2447
@davidntumba2447 5 месяцев назад
Signal slice explained in the prior videos. For a TLDR, signal slice, is a custom utility function that uses rxjs and signals to achive decalritive state management. (Think ngrx or State Adapt results but "simplier") This video builds on those videos/concepts by showing what's "under to hood" of signal slice as well as motivating the use of types when writing a library, class or utility function
@broadenmymind5793
@broadenmymind5793 5 месяцев назад
Thanks for your excellent videos, not only this one but almost every video from you. Can you make more videos about Advanced Typescript? If you have any courses about advanced concept of TypeScript or even Angular. I'm willing to be your enroller
@lancetv4826
@lancetv4826 14 часов назад
I could not even comprehend typing a simple utility; what could be worse?
@puneetarora1714
@puneetarora1714 5 месяцев назад
make videos on your nvim setup
@adambickford8720
@adambickford8720 5 месяцев назад
When java 5 added generics I thought I really 'got it' because it was easy/obvious with things like collections. Then you try to write 'generic' code and it turns out to be way more challenging. Am I producing or consuming a generic type? What should the bounds be? Do I want to express this coupling in the types or add a level of indirection?
@ahmedAltariqi
@ahmedAltariqi 3 месяца назад
Make more similar videos, please!
@potatopower2144
@potatopower2144 5 месяцев назад
It's moments like these that make me question whether or not I will ever be a web developer. Must work harder
@JoshuaMorony
@JoshuaMorony 5 месяцев назад
This stuff can be useful to know, but imo you could probably go an entire career in web dev (and people do) without knowing this. I think it's great if you do want to learn it and it may certainly improve your prospects/value to employers if you do, but for general web development generally a much more basic knowledge of typing is required. Basically what I am trying to say is learning this stuff is great and will improve your skills, but don't feel like you need to conquer stuff like this before you can ever become a web dev.
@vietdungnguyen2409
@vietdungnguyen2409 5 месяцев назад
Why have PartialOrValue? How is it any different from just Partial?
@JoshuaMorony
@JoshuaMorony 5 месяцев назад
signalSlice uses the connect function under the hood which allows both objects and primitive values - although I haven't really even considered the scenario of supplying non-object values to signalSlice, whether that makes sense or not is probably something to look into
@Wielorybkek
@Wielorybkek 5 месяцев назад
on one hand it's great to have good typing but every time I want to look into the types to understand something better and seeing all the generics and utility types mess I just feel like giving up...
@JoshuaMorony
@JoshuaMorony 5 месяцев назад
That's part of what made me want to make this video, if I could have seen the end result of the typing for this before I actually started building it I probably would have just been like "Yeahh... nah I have no idea what's going on here"
@Billiam112
@Billiam112 5 месяцев назад
I feel so stupid watching this (Angular dev for 8 years).
@Wielorybkek
@Wielorybkek 5 месяцев назад
@@Billiam112 I think it's the density of the syntax that's problematic in TS, so much stuff can happen in just a one line. Other thing is it becomes very abstract very fast so at some point you have partials of arrays of generic type of return type of observables then sprinkle some unions and excludes and you no longer know what is the thing you are dealing with. :D at the end add "infer" to the mix and my brain explodes.
@USONOFAV
@USONOFAV 4 месяца назад
dong this: export type Source< TSignalValue > = Signal instead of: export type Source.... made it complicated to look at.
@dumbeldor100
@dumbeldor100 3 месяца назад
Wtf did i just watch. Im so far away from being a tripple X front-end-egineer 😂
Далее
There was a flaw in my Angular mental model
4:50
Просмотров 11 тыс.
Advanced TypeScript is Hard
13:42
Просмотров 32 тыс.
The mindset you need for a DECLARATIVE code refactor
7:56
The Biggest Misconception of PROMISES vs OBSERVABLES
5:07
ﻋﺎﻟﺴﺮﻳﻊ Imperative VS Declarative
5:51
This Is One Of My Favorite TypeScript Features
5:22
Просмотров 129 тыс.
This is why learning typescript generics is important
13:19
Introducing... the NEW Angular framework
9:16
Просмотров 79 тыс.
Here's what I've figured out about Angular signals
8:33
How Angular plans to survive the next 10 years
3:40