my problem is that I want that Product class implements both classes [Review and Category] to get more scalability in my code. However, I got stuck in that. I tried to use even Mixins but I had to re-assign all methods from Category and Review, Does anyone knows a better and smart solution to do so?
interface Fetch {
getInfo() :string;
}
class Review implements Fetch {
getInfo(): string {
return 'Nice Product'
}
getName(): string {
return 'Shirt Star wars'
}
geRate(): string {
return '5 stars'
}
}
class Category implements Fetch {
getInfo(): string {
return 'Nice Category'
}
getCategory(): string {
return 'Geek'
}
getSimilar(): string[] {
return []
}
}
class Product extends Review {
constructor() {
super();
}
}
let Shirt = new Product()
Shirt.getInfo()
Shirt.geRate()