EventSource

open class EventSource(val url: String, init: EventSourceInit = definedExternally) : EventTarget(source)

The EventSource interface is web content's interface to server-sent events.

MDN Reference

Constructors

Link copied to clipboard
constructor(url: URL, init: EventSourceInit = definedExternally)
constructor(url: String, init: EventSourceInit = definedExternally)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface ReadyState

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The readyState read-only property of the connection.

Link copied to clipboard
val url: String

The url read-only property of the URL of the source.

Link copied to clipboard

The withCredentials read-only property of the the EventSource object was instantiated with CORS credentials set.

Functions

Link copied to clipboard
fun close()

The close() method of the EventSource interface closes the connection, if one is made, and sets the ``js-nolint close() `` None.

Link copied to clipboard
Link copied to clipboard