Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

kombini

0.1.0 • Public • Published

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

Keywords

none

install

npm i kombini

Downloadsweekly downloads

0

version

0.1.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability