Closing an event stream

suggest change

Close 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents