2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/core/server/events/index.js

24 lines
532 B
JavaScript
Raw Normal View History

var events = require('events'),
util = require('util'),
EventRegistry,
EventRegistryInstance;
2016-04-10 02:20:56 +02:00
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;