b8ec557e3558ab161555cf9da0573a731ed7cfbf
[motion.git] / server / api / xchatty / xchatty.socket.js
1 /**
2  * Broadcast updates to client when the model changes
3  */
4
5 'use strict';
6
7 var xchatty = require('../../models').Xchatty;
8
9 exports.register = function(socket) {
10   // xchatty.afterCreate(function (doc) {
11   //   onSave(socket, doc);
12   // });
13   // xchatty.afterDestroy(function (doc) {
14   //   onRemove(socket, doc);
15   // });
16 }
17
18 function onSave(socket, doc, cb) {
19   socket.emit('xchatty:save', doc);
20 }
21
22 function onRemove(socket, doc, cb) {
23   socket.emit('xchatty:remove', doc);
24 }