Type-Safe TypeScript with Type Narrowing

preview_player
Показать описание
This video shows common patterns to maximize TypeScript's potential for type-safe code. These techniques are all part of the same group, which we call type narrowing.

0:00 0. Introduction
1:48 1. Code Example
3:11 2. Equality Narrowing
4:25 3. typeof
6:37 4. Truthiness Narrowing
7:28 5. typeof (revisited)
9:25 6. instanceof
11:16 7. Discriminated Union
14:31 8. in
15:29 9. Type Predicate
24:14 10. Zod
26:16 11. Assertion Function
30:03 12. Summary
32:03 13. Farewell
Рекомендации по теме
Комментарии
Автор

When we agree that 'as' is outsmarting TypeScript, should we stop using typecasting in those reactive form getters: `get nameCtrl(){ return this.form.get('...') as FormControl }`?

aram
visit shbcf.ru