event.mjs 566 B

123456789101112131415
  1. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  2. const handleEvent = (event) => {
  3. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
  4. if (checkForDefaultPrevented === false || !shouldPrevent) {
  5. return oursHandler == null ? void 0 : oursHandler(event);
  6. }
  7. };
  8. return handleEvent;
  9. };
  10. const whenMouse = (handler) => {
  11. return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
  12. };
  13. export { composeEventHandlers, whenMouse };
  14. //# sourceMappingURL=event.mjs.map