small filter improvement

This commit is contained in:
Fabian Vogelsteller 2015-06-26 16:55:33 +02:00
parent d59b1cddfc
commit d097821665
6 changed files with 20 additions and 101 deletions

8
dist/web3-light.js vendored
View File

@ -2635,6 +2635,7 @@ var Filter = function (options, methods, formatter, callback) {
});
this.options = getOptions(options);
this.implementation = implementation;
this.filterId = null;
this.callbacks = [];
this.pollFilters = [];
this.formatter = formatter;
@ -2645,12 +2646,13 @@ var Filter = function (options, methods, formatter, callback) {
});
} else {
self.filterId = id;
// get filter logs at start
// get filter logs for the already existing watch calls
self.callbacks.forEach(function(cb){
getLogsAtStart(self, cb);
});
pollFilter(self);
if(self.callbacks.length > 0)
pollFilter(self);
// start to watch immediately
if(callback) {

File diff suppressed because one or more lines are too long

8
dist/web3.js vendored
View File

@ -2635,6 +2635,7 @@ var Filter = function (options, methods, formatter, callback) {
});
this.options = getOptions(options);
this.implementation = implementation;
this.filterId = null;
this.callbacks = [];
this.pollFilters = [];
this.formatter = formatter;
@ -2645,12 +2646,13 @@ var Filter = function (options, methods, formatter, callback) {
});
} else {
self.filterId = id;
// get filter logs at start
// get filter logs for the already existing watch calls
self.callbacks.forEach(function(cb){
getLogsAtStart(self, cb);
});
pollFilter(self);
if(self.callbacks.length > 0)
pollFilter(self);
// start to watch immediately
if(callback) {

87
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

6
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -135,6 +135,7 @@ var Filter = function (options, methods, formatter, callback) {
});
this.options = getOptions(options);
this.implementation = implementation;
this.filterId = null;
this.callbacks = [];
this.pollFilters = [];
this.formatter = formatter;
@ -145,12 +146,13 @@ var Filter = function (options, methods, formatter, callback) {
});
} else {
self.filterId = id;
// get filter logs at start
// get filter logs for the already existing watch calls
self.callbacks.forEach(function(cb){
getLogsAtStart(self, cb);
});
pollFilter(self);
if(self.callbacks.length > 0)
pollFilter(self);
// start to watch immediately
if(callback) {