oortcloud / node-ddp-client

A callback style DDP (Meteor's Distributed Data Protocol) node client.
Other
263 stars 80 forks source link

Added support for collection observation. #45

Closed kubat closed 9 years ago

kubat commented 10 years ago

Collections can now be observerd with callbacks by calling client.observe(collectionName,...). This returns an observer object that can have methods attached to it for additions, removals and updates. Those callbacks are called immediately on DDP messages. The observation can be stopped with a call to stop().

emgee3 commented 10 years ago

Sorry for the delay, a bit swamped right now, but will look at this (and the other) soon. Thx!

cretep commented 9 years ago

Worth noting that in Meteor, observe is a function of Mongo.Cursor not Mongo.Collection.

emgee3 commented 9 years ago

@kubat sorry for the delay in looking at this. The changes look good but I'm concerned there's no tests. I know the test coverage isn't good, but decreasing coverage I'm not interested in. If you add tests, I'll merge (quickly :) )

kubat commented 9 years ago

Hi. Added the requested test and made some linting changes.

emgee3 commented 9 years ago

Thanks, merged!