Files
BitwiseCmd/js/components/commandr.js
Borys Levytskyi 0b3e0ed4fb moved stuff around
2015-04-02 22:06:05 +03:00

25 lines
461 B
JavaScript

(function(){
var commandr = {
};
function Command(name) {
this.name = name;
this.handlers = [];
}
Command.prototype.fire = function (arg) {
for(var i=0; i<1; i++) {
this.handlers[i](arg);
}
};
Command.prototype.subscribe = function (handler) {
this.handlers.push(handler);
// TODO: unsubcribe
};
commandr.Command = Command;
window.commandr = commandr;
})();