Closing an event stream
suggest changeAn 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents