MremoveEventListener
Bun

method

WebSocket.removeEventListener

type: K,
listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
options?: boolean | EventListenerOptions
): void;

Removes an event listener previously registered with addEventListener()

@param type

A case-sensitive string representing the event type to remove

@param listener

The function to remove from the event target

@param options

An options object that specifies characteristics about the event listener

type: string,
options?: boolean | EventListenerOptions
): void;

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference