2 * Broadcast updates to client when the model changes
7 //var thing = require('./thing.model');
8 var thing = require('../../models').Thing;
10 exports.register = function (socket) {
12 thing.afterCreate(function (doc) {
16 thing.afterDestroy(function (doc) {
17 onRemove(socket, doc);
21 function onSave(socket, doc, cb) {
22 socket.emit('thing:save', doc);
25 function onRemove(socket, doc, cb) {
26 socket.emit('thing:remove', doc);