This package has been deprecated

Author message:

please use eventemitter directly

@isoden/eveemi-compat

1.1.2 • Public • Published

eveemi-compat

npm

Installation

$ npm install @isoden/eveemi-compat --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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i @isoden/eveemi-compat

Weekly Downloads

0

Version

1.1.2

License

MIT

Last publish

Collaborators

  • isoden