If you use generic functions in TypeScript, you may have used this pattern without knowing.
In this example, both Dog and Cat are subtypes of Pet. We can create a listen function that accepts any subtypes of Pet.
Collection
[
|
...
]
If you use generic functions in TypeScript, you may have used this pattern without knowing.
In this example, both Dog and Cat are subtypes of Pet. We can create a listen function that accepts any subtypes of Pet.