import { u as useHost, h as dispatchEvent } from './de470d67.js';

function useEvent(type, eventInit = {}) {
    let ref = useHost();
    if (!ref[type]) {
        ref[type] = (detail) =>
            dispatchEvent(ref.current, {
                type,
                ...eventInit,
                detail: detail || eventInit.detail,
            });
    }
    return ref[type];
}

export { useEvent as u };
//# sourceMappingURL=4ecfd297.js.map
