Skip to main content

EventSource

interface EventSource
extends EventTarget

Properties Jump to heading

Jump to headingonerror: ((
ev: Event,
) => any) | null
Jump to headingonmessage: (() => any) | null
Jump to headingonopen: ((
ev: Event,
) => any) | null

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

readonly
Jump to headingurl: string

Returns the URL providing the event stream.

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

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

Jump to headingaddEventListener<K extends keyof EventSourceEventMap>(
type: K,
listener: () => any,
options?: boolean | AddEventListenerOptions,
): void
Jump to headingaddEventListener(
type: string,
listener: () => any,
options?: boolean | AddEventListenerOptions,
): void
Jump to headingremoveEventListener<K extends keyof EventSourceEventMap>(
type: K,
listener: () => any,
options?: boolean | EventListenerOptions,
): void
Jump to headingremoveEventListener(
type: string,
listener: () => any,
options?: boolean | EventListenerOptions,
): void
Back to top