Write Solid Code with Branded Types in TypeScript 🛡️

  Рет қаралды 1,656

TypeScript with Benny Code

TypeScript with Benny Code

Күн бұрын

Пікірлер: 15
@kasir-barati
@kasir-barati 2 ай бұрын
God tier video.
@gambonny
@gambonny 5 ай бұрын
Very informative. Thanks.
@TypeScriptTV
@TypeScriptTV 5 ай бұрын
Happy that you like it! Have you seen my video about generators? kzbin.info/www/bejne/eqi1hGmcYrqtl6M
@AlexanderYaremchuk
@AlexanderYaremchuk 5 ай бұрын
Bypassing of type guard check for value of undefined seems to be not related to additional check of typeof input === "number". undefined is not a number but it is not 0 neither. what for is typeof input === "number" introduced there?
@TypeScriptTV
@TypeScriptTV 4 ай бұрын
Your concern is valid. The `typeof number` check at 16:06 is unnecessary: typescript.tv/hands-on/understanding-branded-types-in-typescript/#using-assertion-functions-with-branded-types Thanks for the hint! Benny
@sakarsr
@sakarsr 5 ай бұрын
Thank you for making this video on the branded type and its issues with the assertion. Putting two or more assertive conditions-one for notzero and another for number-is not possible. Alternatively, is there a way we could make different kinds of barnded nests?
@TypeScriptTV
@TypeScriptTV 5 ай бұрын
Hey, for such complex validations I recommend to use a schema validator like Zod: typescript.tv/hands-on/use-typescript-generators-for-cleaner-programming/#response-schema-definition
@sakarsr
@sakarsr 5 ай бұрын
@@TypeScriptTV I do utilize Zod for my development, yes.
@achimilorava2338
@achimilorava2338 5 ай бұрын
can you make video, using typescript in react?
@TypeScriptTV
@TypeScriptTV 5 ай бұрын
It's a great topic and there is already an excellent course for it on Udemy: www.udemy.com/course/react-typescript-the-practical-guide/
@justAbeautifulSoul409
@justAbeautifulSoul409 3 ай бұрын
how to complicate a simple problem 101
@TypeScriptTV
@TypeScriptTV 3 ай бұрын
It's called Software Architecture. 🙂
@justAbeautifulSoul409
@justAbeautifulSoul409 3 ай бұрын
​@@TypeScriptTV I know. By the way, I was referring to the problem you were solving; it was a simple one and didn't require all those lines of code to handle. Are you aware that many projects don't use TypeScript but still follow software architecture?
@TypeScriptTV
@TypeScriptTV 3 ай бұрын
@@justAbeautifulSoul409 I am aware of this but I like to use small code examples to show the technique so my viewers don't get lost in complex business logic.
Week 0 : Basic Command Line Operations
1:26:01
ArewaDataScience Academy
Рет қаралды 299
Branded Types give you stronger input validation
9:22
Andrew Burgess
Рет қаралды 19 М.
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 189 М.
Fix Every TypeScript Error with This Tool!
16:49
TypeScript with Benny Code
Рет қаралды 2 М.
Node.js Doesn’t Suck Anymore
16:59
Web Dev Simplified
Рет қаралды 133 М.
Type your functions in TypeScript and SAVE TIME
8:31
ThePrimeTime
Рет қаралды 55 М.
This is why learning typescript generics is important
13:19
Web Dev Cody
Рет қаралды 25 М.
as const: the most underrated TypeScript feature
5:38
Matt Pocock
Рет қаралды 128 М.
The Right way to write Nest.js & Typescript clean-code - SOLID
17:55