Skip to content

fulcrumapp/mixmatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());