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