event.js 684 B

1234567891011121314151617181920
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  4. const handleEvent = (event) => {
  5. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
  6. if (checkForDefaultPrevented === false || !shouldPrevent) {
  7. return oursHandler == null ? void 0 : oursHandler(event);
  8. }
  9. };
  10. return handleEvent;
  11. };
  12. const whenMouse = (handler) => {
  13. return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
  14. };
  15. exports.composeEventHandlers = composeEventHandlers;
  16. exports.whenMouse = whenMouse;
  17. //# sourceMappingURL=event.js.map