UNPKG

vuestic-ui

Version:
1 lines 761 B
{"version":3,"file":"useCaptureEvent.mjs","sources":["../../../../src/composables/useCaptureEvent.ts"],"sourcesContent":["import { onMounted, onBeforeUnmount } from 'vue'\n\n/** Register globally event catcher. SSR safe */\nexport const useCaptureEvent = (event: string, cb: (...args: any[]) => void, options: AddEventListenerOptions = {}) => {\n onMounted(() => window.addEventListener(event, cb, { capture: true, ...options }))\n onBeforeUnmount(() => window.removeEventListener(event, cb, { capture: true, ...options }))\n}\n"],"names":[],"mappings":";AAGO,MAAM,kBAAkB,CAAC,OAAe,IAA8B,UAAmC,CAAA,MAAO;AAC3G,YAAA,MAAM,OAAO,iBAAiB,OAAO,IAAI,EAAE,SAAS,MAAM,GAAG,QAAQ,CAAC,CAAC;AACjE,kBAAA,MAAM,OAAO,oBAAoB,OAAO,IAAI,EAAE,SAAS,MAAM,GAAG,QAAQ,CAAC,CAAC;AAC5F;"}