0.1.0 • Published 9 years ago

kombini v0.1.0

Weekly downloads
4
License
-
Repository
github
Last release
9 years ago

Kombini

A basic interface for creating object mixins.

Static Methods

Kombini.extend(obj)

Defines a new Kombini mixin.

let SlapMixin = Kombini.extend({
  slapCount: 0,
  slap: function () {
    this.slapCount++;
  }
});

Kombini.mixin(obj, opts)

Extends interface into a target object.

var person = { name: 'Billy' }
SlapMixin.mixin(person);

person.slapCount // ==> 0
person.slap();
person.slapCount // ==> 1