UNPKG

mongo-portable

Version:

Portable Pure JS MongoDB - Based on Monglodb (https://github.com/euforic/monglodb.git) by Christian Sullivan (http://RogueSynaptics.com)

1 lines 2.79 kB
{"filter":false,"title":"EventEmitter.js","tooltip":"/browser/utils/EventEmitter.js","undoManager":{"mark":0,"position":0,"stack":[[{"start":{"row":2,"column":0},"end":{"row":46,"column":30},"action":"remove","lines":["var logger = null;","","class EventEmitter {"," constructor() {"," logger = Logger.instance;"," }"," "," emit(name, args, cb, stores) {"," if (_.isNil(name) || !_.isString(name)) {"," throw new Error(\"Error on name\");"," }"," "," if (_.isNil(args)) {"," args = {};"," cb = null;"," }"," "," if (_.isNil(cb)) {"," cb = null;"," }"," "," if (_.isFunction(args)) {"," cb = args;"," args = {};"," }"," "," if (!_.isNil(stores) && _.isArray(stores)) {"," this._stores = stores;"," }"," "," var command = name;"," "," logger.info('Emitting store event ' + name);"," logger.debug(args);"," "," // Send event to all the stores registered"," _.forEach(this._stores, function (fn) {"," if (_.isFunction(fn[command])) {"," fn[command](args, cb);"," }"," });"," }","}","","module.exports = EventEmitter;"],"id":2},{"start":{"row":2,"column":0},"end":{"row":46,"column":30},"action":"insert","lines":["var logger = null;","","class EventEmitter {"," constructor() {"," logger = Logger.instance;"," }"," "," emit(name, args, cb, stores) {"," if (_.isNil(name) || !_.isString(name)) {"," throw new Error(\"Error on name\");"," }"," "," if (_.isNil(args)) {"," args = {};"," cb = null;"," }"," "," if (_.isNil(cb)) {"," cb = null;"," }"," "," if (_.isFunction(args)) {"," cb = args;"," args = {};"," }"," "," if (!_.isNil(stores) && _.isArray(stores)) {"," this._stores = stores;"," }"," "," var command = name;"," "," logger.info('Emitting store event ' + name);"," logger.debug(args);"," "," // Send event to all the stores registered"," _.forEach(this._stores, function (fn) {"," if (_.isFunction(fn[command])) {"," fn[command](args, cb);"," }"," });"," }","}","","module.exports = EventEmitter;"]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":2,"column":18},"end":{"row":2,"column":18},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1470298271721,"hash":"bf7364d04bcd07064a9638d2a063041660e151f1"}