import { g as useHost, h as dispatchEvent } from './456564be.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=d4058887.js.map
