EventSource

open external class EventSource : EventTarget (source)

Platform and version requirements: JS

Exposes the JavaScript EventSource to Kotlin

Constructors

<init>

EventSource(
    url: String,
    eventSourceInitDict: EventSourceInit = definedExternally)

Exposes the JavaScript EventSource to Kotlin

Properties

onerror

var onerror: (Event) -> dynamic

onmessage

var onmessage: (Event) -> dynamic

onopen

var onopen: (Event) -> dynamic

readyState

open val readyState: Short

url

open val url: String

withCredentials

open val withCredentials: Boolean

Functions

close

fun close()

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

dispatchEvent

fun dispatchEvent(event: Event): Boolean

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

Companion Object Properties

CLOSED

val CLOSED: Short

CONNECTING

val CONNECTING: Short

OPEN

val OPEN: Short