Skip to main content
Module

x/evt/mod.ts>dom.CloseEvent

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.CloseEvent
implements Event
import { type dom } from "https://deno.land/x/evt@v2.4.3/mod.ts";
const { CloseEvent } = dom;

A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute.

Properties

readonly
code: number

Returns the WebSocket connection close code provided by the server.

readonly
reason: string

Returns the WebSocket connection close reason provided by the server.

readonly
wasClean: boolean

Returns true if the connection closed cleanly; false otherwise.