EventUtils API
createCustomEvent()
Create a custom event.
type:
function
tsfunction createCustomEvent(type?: string, bubbles?: boolean, cancelable?: boolean): never | void | Event;
example
tsimport { EventUtils } from "@shihongxins/utils"; const resize = EventUtils.createCustomEvent("resize");
dispatchCustomEvent()
Dispatch the custom event.
type:
function
tsfunction dispatchCustomEvent(event: Event, target?: Window | IE8Document | Element): never | void;
example
tsimport { EventUtils } from "@shihongxins/utils"; EventUtils.dispatchCustomEvent(resize);