Thanks for sharing!
I’m thinking of another alternative which involves using a service that will contain all the shared methods. It’s similar to the Class Inheritance way, except that all that methods in the service are pure and there will be no public properties that could directly relate to the service consumer.
On the upside, if the service injects some dependencies, you won’t have to do super(dep1, dep2, ...) for each consumer.
On the downside, if the consumers share a lot of properties, then redeclaring the same again and again properties for each consumer might become tedious.
I used the Class Inheritance alternative when the consumers of the component would share a lot of properties and methods. Otherwise, I would’ve used a service.
What’s your opinion that?
