Mixin: events

events

This mixin provides on(), once(), off() and emit() methods to fire and receive events.
Source:

Example

var collection = new KagoDB();

collection.on('hello', function(data) {
  console.log('Hello,', data);
});

collection.emit('hello', 'world!'); // => 'hello, world!'