Skip to main content
variable triggerEvent
import { triggerEvent } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Triggers a specific event on a given element, optionally passing custom data.

Use new CustomEvent() to create an event from the specified eventType and details. Use el.dispatchEvent() to trigger the newly created event on the given element. Omit the third argument, detail, if you do not want to pass custom data to the triggered event.

type

(
eventType: string,
detail: any,
) => unknown