insight-ui-zcash/app/views/sockets/main.js

17 lines
372 B
JavaScript
Raw Normal View History

2014-01-13 13:13:41 -08:00
'use strict';
var Transaction = require('../../models/Transaction');
// server-side socket behaviour
2014-01-13 13:13:41 -08:00
module.exports = function(app, io) {
io.set('log level', 1); // reduce logging
io.sockets.on('connection', function(socket) {
2014-01-13 14:07:12 -08:00
Transaction.findOne(function(err, tx) {
setTimeout(function() {
socket.emit('tx', tx);
}, 5000);
2014-01-13 13:13:41 -08:00
});
});
};