mixin
A reusable piece of shape or behaviour that is combined into other types, instead of inherited from a single parent class.
In more detail
In types, intersections are the usual way to mix traits such as SoftDeletable into an entity. TypeScript also supports class mixins built with functions that extend a class.
Related terms
- intersection type — A type written A & B that requires a value to satisfy both types at once, combining their properties.
- inheritance — Declaring one class or type as a specialised version of another, so it receives the parent's members and can be used wherever the parent is expected.
Taught in
- Union Types, Intersections And Property Conflicts — Production TypeScript