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 callbacks on collection additions, removals and updates #44

Closed kubat closed 10 years ago

kubat commented 10 years ago

This maintains backward compatibility, but allows users to specifiy a map of functions to handle subscription events, including 'nosub' and 'ready'. This allows monitoring for changes to collections happening through mechanisms other than rpcs.

For added, changed, and removed, the ID of the relevant collection object is passed. In the case of removed, the original object is passed as well.

The backwards compatible behaviour uses the generic callback for nosub and ready events.

kubat commented 10 years ago

After some reflection, I want to rework this and resubmit.