Skip to main content
Latest
method EventEmitter.createEvent
import { EventEmitter } from "https://deno.land/x/evtemitter@v3.1.0/EventEmitter.ts";

create a typed CustomEvent, which will have a typed type property

Parameters

type: EvName

The type / name of the event, will be the type property

create a typed CustomEvent, which will have types for the detail and the type property

Type Parameters

Type extends EvName
Detail

Parameters

type: EvName

The type / name of the event, will be the type property

detail: Detail

Optional - the detail of the event, will be the detail property

optional
init: Omit<CustomEventInit, "detail">

Optional - a CustomEventInit object without the detail property