Skip to content

Instantly share code, notes, and snippets.

@roberts-sandbox
Forked from neoGeneva/gist:1309070
Created January 31, 2013 19:15
Show Gist options
  • Save roberts-sandbox/4685534 to your computer and use it in GitHub Desktop.
Save roberts-sandbox/4685534 to your computer and use it in GitHub Desktop.
var createEvent = function() {
var _handlers = [];
return function() {
if (arguments.length === 1 && typeof arguments[0] === 'function') {
_handlers.push(arguments[0]);
return;
}
for (var i = 0; i < _handlers.length; ++i) {
_handlers[i].apply(this, arguments);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment