parsing events output
This commit is contained in:
@ -36,6 +36,8 @@ var Filter = function(options, impl) {
|
||||
if (options.topics) {
|
||||
console.warn('"topics" is deprecated, use "topic" instead');
|
||||
}
|
||||
|
||||
this._onWatchResult = options._onWatchEventResult;
|
||||
|
||||
// evaluate lazy properties
|
||||
options = {
|
||||
@ -71,7 +73,8 @@ Filter.prototype.changed = function(callback) {
|
||||
Filter.prototype.trigger = function(messages) {
|
||||
for (var i = 0; i < this.callbacks.length; i++) {
|
||||
for (var j = 0; j < messages.length; j++) {
|
||||
this.callbacks[i].call(this, messages[j]);
|
||||
var message = this._onWatchResult ? this._onWatchResult(messages[j]) : messages[j];
|
||||
this.callbacks[i].call(this, message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user