Which Vue Developers should learn TypeScript?
4:22
Installing TypeScript, Transpiling and Watching Files
4:44
Introduction to TypeScript’s Types
8:38
A Quick Tour of TypeScript’s Basic Types
9:21
Functions and Types in Typescript
9:42
Custom Types and Literal Types
6:02
Custom Object Types in TypeScript
7:44
Type Intersections
7:36
Type Unions
7:48
Interfaces
7:50
Intro to TypeScript - Conclusion (for now)
1:19
Generics
10:11
0% done with TypeScript: The Vue Parts

Generics

Generics keep a type constant throughout your code but don’t specify the exact type. They’re a useful way to make your functions, interfaces, and types more reusable without losing TypeScript’s benefits.

The “hello world” of Generics is the Identity function - it just returns what it gets as an argument.

To make Generics more practical, we must do one of two things: Set constraints on what the Generic Type can be Specify the structure of your data, without constraining the Type

We show toy examples of both, and then show an example from the Vue 3 source code.

After this video, you should be able to decipher most TypeScript code.

Handbook Docs https://www.typescriptlang.org/docs/handbook/generics.html

Vue 3 Example

https://github.com/vuejs/vue-next/blob/09b4202a22ae03072a8a8405511e37f65b626568/packages/runtime-core/src/renderer.ts#L83

What do others think of VueScreencasts?
"Really nice video with nice explanation. Subscribe"
—Igor Špánik
"Thank you for putting in the effort to make these videos and share with all!"
—Ritika Singh
"It's very helpful. Thank you for a great tutorial."
—Abdulaziz Al Ghafli
"Thank you for putting in the effort to make these videos and share with all!"
—Ritika Singh
Take your career to the next level