Skip to content

Instantly share code, notes, and snippets.

@dkhmelenko
Last active May 13, 2021 09:00
Show Gist options
  • Save dkhmelenko/bebbb8ec59e2bee3e4c233346e9d5932 to your computer and use it in GitHub Desktop.
Save dkhmelenko/bebbb8ec59e2bee3e4c233346e9d5932 to your computer and use it in GitHub Desktop.
var source = new EventSource('/updates');
source.addEventListener('time_update', function(event) {
console.log(event.data);
});
...
source.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment