Mixins are useful when you need code sharing without using inheritance . When you use class B with A {} you are importing every method of mixin A into your class B . Optionally, the usage of a mixin can be constrained to a certain type using the on keyword.15 Haz 2021