many optimizations in addresses pulling
This commit is contained in:
parent
425703c447
commit
398daf3f05
9 changed files with 183 additions and 130 deletions
|
|
@ -19,7 +19,6 @@ angular.module('copay.socket').factory('Socket',
|
|||
};
|
||||
|
||||
socket.on(event, wrappedCallback);
|
||||
|
||||
if (event !== 'connect') {
|
||||
listeners.push({
|
||||
event: event,
|
||||
|
|
@ -27,6 +26,14 @@ angular.module('copay.socket').factory('Socket',
|
|||
});
|
||||
}
|
||||
},
|
||||
getListeners: function() {
|
||||
var ret = {};
|
||||
var addrList = listeners.map(function(i) {return i.event;});
|
||||
for (var i in addrList) {
|
||||
ret[addrList[i]] = 1;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
emit: function(event, data, callback) {
|
||||
socket.emit(event, data, function() {
|
||||
var args = arguments;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue