mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
ac2578b419
refs #9178
23 lines
532 B
JavaScript
23 lines
532 B
JavaScript
var events = require('events'),
|
|
util = require('util'),
|
|
EventRegistry,
|
|
EventRegistryInstance;
|
|
|
|
EventRegistry = function () {
|
|
events.EventEmitter.call(this);
|
|
};
|
|
|
|
util.inherits(EventRegistry, events.EventEmitter);
|
|
|
|
EventRegistry.prototype.onMany = function (arr, onEvent) {
|
|
var self = this;
|
|
|
|
arr.forEach(function (eventName) {
|
|
self.on(eventName, onEvent);
|
|
});
|
|
};
|
|
|
|
EventRegistryInstance = new EventRegistry();
|
|
EventRegistryInstance.setMaxListeners(100);
|
|
|
|
module.exports = EventRegistryInstance;
|