EventSource

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

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

Returns the state of this EventSource object's connection. It can have the values described below.

Link copied to clipboard
val url: String

Returns the URL providing the event stream.

Link copied to clipboard

Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.

Functions

Link copied to clipboard
fun close()

Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.

Link copied to clipboard