2 * Broadcast updates to client when the model changes
7 var xchatty = require('../../models').Xchatty;
9 exports.register = function(socket) {
10 // xchatty.afterCreate(function (doc) {
11 // onSave(socket, doc);
13 // xchatty.afterDestroy(function (doc) {
14 // onRemove(socket, doc);
18 function onSave(socket, doc, cb) {
19 socket.emit('xchatty:save', doc);
22 function onRemove(socket, doc, cb) {
23 socket.emit('xchatty:remove', doc);