Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.shared_globals.d.ts>dispatchEvent

A modern runtime for JavaScript and TypeScript.
Latest
function dispatchEvent
import { dispatchEvent } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.shared_globals.d.ts";

Dispatches an event in the global scope, synchronously invoking any registered event listeners for this event in the appropriate order. Returns false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true.

dispatchEvent(new Event('unload'));

Returns

boolean