Skip to content

Commit 6a37c0e

Browse files
committed
Merge pull request #72 from rclai/patch-1
Fix adding changed handler on observer creator
2 parents 3f51599 + 5fe08ff commit 6a37c0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ddp-client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,10 @@ DDPClient.prototype.unsubscribe = function(id) {
506506
/**
507507
* Adds an observer to a collection and returns the observer.
508508
* Observation can be stopped by calling the stop() method on the observer.
509-
* Functions for added, updated and removed can be added to the observer
509+
* Functions for added, changed and removed can be added to the observer
510510
* afterward.
511511
*/
512-
DDPClient.prototype.observe = function(name, added, updated, removed) {
512+
DDPClient.prototype.observe = function(name, added, changed, removed) {
513513
var self = this;
514514
var observer = {};
515515
var id = self._getNextId();
@@ -523,7 +523,7 @@ DDPClient.prototype.observe = function(name, added, updated, removed) {
523523
Object.defineProperty(observer, "_id", { get: function() { return id; }});
524524

525525
observer.added = added || function(){};
526-
observer.updated = updated || function(){};
526+
observer.changed = changed || function(){};
527527
observer.removed = removed || function(){};
528528

529529
observer.stop = function() {

0 commit comments

Comments
 (0)