simplified synchronous polling
This commit is contained in:
@@ -32,8 +32,7 @@ var Filter = function(options, impl) {
|
||||
this.callbacks = [];
|
||||
|
||||
this.id = impl.newFilter(options);
|
||||
web3.on(impl.changed, this.id, this.trigger.bind(this));
|
||||
web3.provider.startPolling({call: impl.changed, args: [this.id]}, this.id);
|
||||
web3.provider.startPolling({call: impl.changed, args: [this.id]}, this.id, this.trigger.bind(this));
|
||||
};
|
||||
|
||||
/// alias for changed*
|
||||
@@ -57,7 +56,6 @@ Filter.prototype.trigger = function(messages) {
|
||||
Filter.prototype.uninstall = function() {
|
||||
this.impl.uninstallFilter(this.id);
|
||||
web3.provider.stopPolling(this.id);
|
||||
web3.off(impl.changed, this.id);
|
||||
};
|
||||
|
||||
/// should be called to manually trigger getting latest messages from the client
|
||||
|
Reference in New Issue
Block a user