Skip to content
mixin interface
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
source
tests
.gitignore
.jshintrc
.npmignore
LICENSE
README.md
package.json

README.md

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.