Mixin: dynamic_mixin

dynamic_mixin

This mixin provides a dynamic mixin loader which awakes at the first time when the methods called.
Source:

Example

var MyKago = KagoDB.inherit();

var hello_mixin = {
  hello: function() {
    console.log('world!');
  }
};

var dynamic_mixin = KagoDB.bundle.dynamic_mixin;
MyKago.mixin(dynamic_mixin('keyname'));
MyKago.bundle.hello_mixin = hello_mixin;

var opts = {
  storage: 'memory',
  keyname: 'hello_mixin'
};

var collection = new MyKago(opts);
collection.noop(); // abrakadabra
collection.hello(); // => 'world!'