An interface to the Server-Sent Events API (SSE).
Not all browsers support this API. See Browser Compatibility.
The state of the EventSource connection.
CONNECTING The connection has not yet been established, or it was closed and the user agent is reconnecting.
OPEN The user agent has an open connection and is dispatching as it receives them.
CLOSED The connection is not open, and the user agent is not trying to reconnect. Either there was a fatal error or the close() method was invoked.
EventSource class. Inherits from EventTarget
It connects to a server over HTTP and receives events in
text/event-stream format without closing the connection.