Skip to content

Instantly share code, notes, and snippets.

@sairamkrish
Created August 5, 2020 19:14
Show Gist options
  • Save sairamkrish/d45f1dc430983b3af55eee2ff6e5d48f to your computer and use it in GitHub Desktop.
Save sairamkrish/d45f1dc430983b3af55eee2ff6e5d48f to your computer and use it in GitHub Desktop.
const evtSource = new EventSource("http://localhost:8080/status/stream?param1=test");
evtSource.addEventListener("update", function(event) {
// Logic to handle status updates
console.log(event)
});
evtSource.addEventListener("end", function(event) {
console.log('Handling end....')
evtSource.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment