Category Typescript

Generics in Typescript – How To Type Reusable Parts of Code?

If you follow the DRY rule in writing your code in Typescript, the Generic Types are for you! Thanks to Generic Types you can easily create reusable functions, interfaces or classes instead of writing single types for each one. Generics allow you to use different types of providing parameters to one reusable part of code. […]