Created
June 5, 2022 20:25
-
-
Save AitorAlejandro/6bc32138e422bb38ffcab26169ea9795 to your computer and use it in GitHub Desktop.
Identifiable example TS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Identifiable<T> { | |
id: T; | |
} | |
class Product implements Identifiable<string> { | |
id: string; | |
constructor(id: string) { | |
this.id = id; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment