dispatch/client/src/js/actions/message.js
2015-06-02 00:09:36 +02:00

18 lines
328 B
JavaScript

var Reflux = require('reflux');
var socket = require('../socket');
var messageActions = Reflux.createActions([
'send',
'add',
'broadcast',
'inform',
'command',
'setWrapWidth'
]);
messageActions.send.preEmit = (message, to, server) => {
socket.send('chat', { server, to, message });
};
module.exports = messageActions;