Closing an event stream
suggest changeClose a browser EventSource with close():
var eventSource = new EventSource("api/my-events");
// do things ...
eventSource.close(); // this object receives no further events
.close() does nothing if the stream is already closed. It does not tell the server to stop sending.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents