1.1.7 • Published 9 years ago

@isoden/eveemi v1.1.7

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

EveEmi

npm

Installation

$ npm install @isoden/eveemi --save

Usage

var Model = function () {
  EveEmi.apply(this, arguments);

  this.attrs = {};
};
Model.prototype = new EveEmi();

Model.prototype.set = function (key, value) {
  this.attrs[key] = value;
  this.trigger('set');
};

var model = new Model();

model.on('set', function () {
  alert('set!');
});

model.set('name', 'isoden'); // alert: 'set!'

API

on(type: string, callback: function, ctx: object, once: boolean = false)

once(type: string, callback: function, ctx: object)

off(type: string, func: function)

listenTo(target: EveEmi, type: string, callback: function, ctx: object, once: boolean = false)

listenToOnce(target: EveEmi, type: string, callback: function, ctx: object)

trigger(type: string, ...args)

License

MIT License http://isoden.mit-license.org

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago