Closing an event stream

suggest change

An event stream to the server can be closed using the EventSource.close() method

var eventSource = new EventSource("api/my-events");
// do things ...
eventSource.close(); // you will not receive anymore events from this object

The .close() method does nothing is the stream is already closed.

Feedback about page:

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



Table Of Contents