Commits

Boo  committed 2b87afd

Remove setTimeout

  • Participants
  • Parent commits 655b632

Comments (0)

Files changed (1)

File public/troll.js

     }
 }
 
-setTimeout(function() {
-    var source = new EventSource('/events');
-    source.addEventListener('comments', function(e) {
-        drawTree(JSON.parse(e.data));
-    }, false);
-    source.addEventListener('comment', function(e) {
-        insertComment(JSON.parse(e.data));
-    }, false);
-    source.onopen = function(e) {
-    };
-    source.onerror = function(e) {
-    };
-}, 500);
+var source = new EventSource('/events');
+source.addEventListener('comments', function(e) {
+    drawTree(JSON.parse(e.data));
+}, false);
+source.addEventListener('comment', function(e) {
+    insertComment(JSON.parse(e.data));
+}, false);
 
 function defaultForm() {
     $('form#reply textarea').val('');