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