From ef5a1acb720cd280ceb620831cef595acdfb1ea8 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 2 Feb 2015 15:56:53 -0300 Subject: [PATCH] add dependencies to event emitter --- lib/server.js | 9 +++++++++ package.json | 1 + 2 files changed, 10 insertions(+) diff --git a/lib/server.js b/lib/server.js index 7b888b5..13346b6 100644 --- a/lib/server.js +++ b/lib/server.js @@ -5,6 +5,8 @@ var $ = require('preconditions').singleton(); var async = require('async'); var log = require('npmlog'); log.debug = log.verbose; +var inherits = require('inherits'); +var events = require('events'); var Bitcore = require('bitcore'); var PublicKey = Bitcore.PublicKey; @@ -33,6 +35,13 @@ function CopayServer(opts) { this.storage = opts.storage || new Storage(); }; +inherits(CopayServer, events.EventEmitter); + +CopayServer._emit = function (event) { + var args = Array.prototype.slice.call(arguments); + log.debug('Emitting: ', args); + this.emit.apply(this, arguments); +}; /** * Creates a new wallet. diff --git a/package.json b/package.json index edf8119..96cd865 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "bitcore": "^0.8.6", "bitcore-explorers": "^0.9.1", "express": "^4.10.0", + "inherits": "^2.0.1", "leveldown": "^0.10.0", "levelup": "^0.19.0", "lodash": "^2.4.1",