AJAX HeartBeats


var Hz = 2; // tick frequency

function tick() {
  fetch('/quidditch/heartbeat')
    .then(function(response) {
      console.log(response.json());
    };
}

setInterval(tick, 1000/Hz);