Files
repository.ts
What you'll learn
- Write generic functions whose return type follows from their arguments
- Constrain a type parameter with extends, and use keyof and T[K] to type a key and its value
- Write a generic class and use it for different types
Press Run tests to start the app. Its log appears here.Tests
- repository.spec.tsrun to see its tests