EventSource

open external class EventSource(url: String, eventSourceInitDict: EventSourceInit) : EventTarget

Exposes the JavaScript EventSource to Kotlin

Constructors

EventSource
Link copied to clipboard
fun EventSource(url: String, eventSourceInitDict: EventSourceInit = definedExternally)

Types

Companion
Link copied to clipboard
object Companion

Functions

addEventListener
Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun addEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
close
Link copied to clipboard
fun close()
dispatchEvent
Link copied to clipboard
fun dispatchEvent(event: Event): Boolean
removeEventListener
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)

Properties

onerror
Link copied to clipboard
var onerror: (Event) -> dynamic?
onmessage
Link copied to clipboard
var onmessage: (MessageEvent) -> dynamic?
onopen
Link copied to clipboard
var onopen: (Event) -> dynamic?
readyState
Link copied to clipboard
open val readyState: Short
url
Link copied to clipboard
open val url: String
withCredentials
Link copied to clipboard
open val withCredentials: Boolean