jeromeetienne / microevent.js

event emitter microlibrary - 20lines -for node and browser

Home Page:http://notes.jetienne.com/2011/03/22/microeventjs.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For what is the mixin good?

yckart opened this issue · comments

Why we don't just use the MicroEvent-function instead?

var MicroEvent = function (obj) {
    var props = ['on', 'off', 'trigger'],
        i = props.length;

    // https://github.com/jeromeetienne/microevent.js/issues/14#issuecomment-14873127
    obj = typeof obj === "function" ? obj.prototype : obj;
    while (i--) obj[props[i]] = Eventer.prototype[props[i]];
};