Introduction
Along with traditional OO hierarchies, another popular way of building up classes from reusable components is to build them by combining simpler partial classes. You may be familiar with the idea of mixins or traits for languages like Scala, and the pattern has also reached some popularity in the JavaScript community.
Mixin sample
In the code below, we show how you can model mixins in TypeScript. After the code, we’ll break down how it works.
// Disposable Mixin
class Disposable {