slate/common/custom-events.js

5 lines
142 B
JavaScript

export const dispatchCustomEvent = ({ name, detail }) => {
let event = new CustomEvent(name, { detail });
window.dispatchEvent(event);
};