Add client side event handlers for update-* events.

This commit is contained in:
Patrick Jentsch
2019-08-29 11:37:00 +02:00
parent cf56394441
commit 876eb465b8
2 changed files with 15 additions and 5 deletions

View File

@ -26,17 +26,27 @@
var socket = io();
socket.on('init-corpora', function(msg) {
corpora = JSON.parse(msg.data);
corpora = JSON.parse(msg);
for (subscriber of corporaSubscribers) {subscriber.init();}
});
socket.on('init-jobs', function(msg) {
jobs = JSON.parse(msg.data);
jobs = JSON.parse(msg);
for (subscriber of jobsSubscribers) {subscriber.init();}
});
socket.on('update-corpora', function(msg) {
console.log(msg);
});
socket.on('update-jobs', function(msg) {
console.log(msg);
});
socket.on('message', function(msg) {
console.log(msg);
});