0.0.4 • Published 2 years ago

mixmatch v0.0.4

Weekly downloads
2,425
License
BSD-3-Clause
Repository
github
Last release
2 years ago

mixmatch

Yet another mixin.

Installation

npm install mixmatch

Example

import Mixin from 'mixmatch';

class HasHeight extends Mixin {
  get height() {
    return 72;
  }

  heightAsMeters() {
    return this.height * 0.0254;
  }
}

class Person {
  constructor(name) {
    this.name = name;
  }
}

HasHeight.includeInto(Person);

const me = new Person('me');

console.log(me.height);
console.log(me.heightAsMeters());