Skip to main content
WebSocket.addEventListener - WebSockets - Web documentation
method WebSocket.addEventListener
WebSocket.addEventListener<K extends keyof WebSocketEventMap>(
type: K,
listener: () => any,
options?: boolean | AddEventListenerOptions,
): void

Type Parameters

K extends keyof WebSocketEventMap

Parameters

type: K
listener: () => any
optional
options: boolean | AddEventListenerOptions

Return Type

void
WebSocket.addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void

Parameters

type: string
optional
options: boolean | AddEventListenerOptions

Return Type

void