@aqua-ds/web-components
Version:
AquaDS Web Components
15 lines (13 loc) • 376 B
JavaScript
function emitEvent(eventName, hostElement, detail, event, options) {
if (event)
event.stopPropagation();
const customEvent = new CustomEvent(eventName, {
detail: { ...detail },
bubbles: true,
cancelable: false,
composed: true,
...options
});
hostElement.dispatchEvent(customEvent);
}
export { emitEvent as e };