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

Taught in

References