node-ddp-client icon indicating copy to clipboard operation
node-ddp-client copied to clipboard

Added changed, removed and added events back to the observer

Open navelpluisje opened this issue 9 years ago • 5 comments

Resolves #10 Added changed, removed and added events back to the observer. Added the fields which have been added to the response of the observer.

navelpluisje avatar Oct 17 '15 15:10 navelpluisje

Sorry if I'm coming off as a pedant (I was working on the same fixes but hadn't gotten around to making the PR), the last thing I'dd add to this PR is bumping the minor version of the lib to 0.1.3 in the package.json so that it can be republished by @hharnisc as soon as its merged.

sunny-g avatar Oct 17 '15 16:10 sunny-g

I think the versioning has to be done by @hharnisc, this because he's the maintainer. About the code @ line 466 it is just as it is in the master branche. For that reason I left t as it is.

navelpluisje avatar Oct 17 '15 16:10 navelpluisje

@navelpluisje I guess you're right about the versioning, though you can't republish the same version to NPM, you'd have to bump at least the minor version.

The change I'm referencing on line 466 is changing the passed in parameter to changed and the observe function's name to changed from updated since changed is what you called in your PR and that's what the DDP message type is.

sunny-g avatar Oct 17 '15 17:10 sunny-g

@sunny-g In DDP there's a difference between updated and changed. You can read more about it here https://github.com/meteor/.

navelpluisje avatar Oct 17 '15 17:10 navelpluisje

@navelpluisje I know, changed refers to changes in the subscription whereas updated refers to Meteor's call and RPC functionality: DDP.md. You called observer.changed in your PR, but the observer still has an updated method attached to it by default within the observe function.

Compare: https://github.com/hharnisc/node-ddp-client/blob/master/index.js#L470 to https://github.com/hharnisc/node-ddp-client/pull/11/files#diff-168726dbe96b3ce427e7fedce31bb0bcR236

sunny-g avatar Oct 17 '15 17:10 sunny-g