@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
11 lines • 407 B
JavaScript
import { cloneEvent } from '../helpers/cloneEvent';
export const dispatchSyntheticEvent = ({ element, eventType }) => {
let syntheticEvent;
element.addEventListener(eventType, event => {
syntheticEvent = cloneEvent(event);
});
const genericEvent = new Event(eventType);
element.dispatchEvent(genericEvent);
return syntheticEvent;
};
//# sourceMappingURL=syntheticEvent.js.map