minivents
http://allouis.github.io/minivents/
API
on
: Listen to event. Params { type:String
, callback:Function
| context:Object
}
off
: Stop listening to event. Params { type:String
| callback:Function
}
emit
: Emit event. Params { type:String
| data:Object
}
Constructor Example
var sandbox = new Events();
sandbox.on("event", function(){
});
sandbox.emit("event");
sandbox.off("event");
sandbox.emit("event");
Mixin Example
var sandbox = {
otherStuff: true
};
Events(sandbox);
sandbox.on("event", function(){
});
sandbox.emit("event");
sandbox.off("event");
sandbox.emit("event");