Skip to content

Commit

Permalink
Merge pull request #72 from rclai/patch-1
Browse files Browse the repository at this point in the history
Fix adding changed handler on observer creator
  • Loading branch information
vsivsi committed Mar 31, 2016
2 parents 3f51599 + 5fe08ff commit 6a37c0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ddp-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ DDPClient.prototype.unsubscribe = function(id) {
/**
* Adds an observer to a collection and returns the observer.
* Observation can be stopped by calling the stop() method on the observer.
* Functions for added, updated and removed can be added to the observer
* Functions for added, changed and removed can be added to the observer
* afterward.
*/
DDPClient.prototype.observe = function(name, added, updated, removed) {
DDPClient.prototype.observe = function(name, added, changed, removed) {
var self = this;
var observer = {};
var id = self._getNextId();
Expand All @@ -523,7 +523,7 @@ DDPClient.prototype.observe = function(name, added, updated, removed) {
Object.defineProperty(observer, "_id", { get: function() { return id; }});

observer.added = added || function(){};
observer.updated = updated || function(){};
observer.changed = changed || function(){};
observer.removed = removed || function(){};

observer.stop = function() {
Expand Down

0 comments on commit 6a37c0e

Please sign in to comment.