1.6.0 • Published 3 years ago

mixof v1.6.0

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

mixof

Tiny mixin system for modern JavaScript

const mixOf = require('mixof');

let squeaking = (superclass) => class extends superclass {
  squeak() {
    if (super.squeak) super.squeak();
    return 'Squeak!';
  }
};

let speaking = (superclass) => class extends superclass {
  speak() {
    if (super.speak) super.speak();
    return 'How does an individual influence the realm of the living?';
  }
};

class Soul {}

class Monstrosity extends mixOf(Soul).with(squeaking, speaking) {