Skip to content

Instantly share code, notes, and snippets.

@auryn31
Created June 25, 2019 09:16
Show Gist options
  • Save auryn31/624197129a12f544dc11ced14ff56856 to your computer and use it in GitHub Desktop.
Save auryn31/624197129a12f544dc11ced14ff56856 to your computer and use it in GitHub Desktop.
let evtSource = new EventSource("http://localhost:8080/cars/sse");
evtSource.onmessage = function(e: any) {
if(e.data == "done") {
evtSource.close();
} else {
commitAsyncCar(store, JSON.parse(e.data));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment