Created
August 5, 2020 19:14
-
-
Save sairamkrish/d45f1dc430983b3af55eee2ff6e5d48f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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