You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Scripted/website/node_modules/.cache/babel-loader/a8d8d777aa3d6fca0a23ab5dcf8...

1 line
2.2 KiB

{"ast":null,"code":"import useEventListener from './useEventListener';\nimport { useCallback } from 'react';\n\n/**\n * Attaches an event handler outside directly to the `document`,\n * bypassing the react synthetic event system.\n *\n * ```ts\n * useGlobalListener('keydown', (event) => {\n * console.log(event.key)\n * })\n * ```\n *\n * @param event The DOM event name\n * @param handler An event handler\n * @param capture Whether or not to listen during the capture event phase\n */\nexport default function useGlobalListener(event, handler, capture) {\n if (capture === void 0) {\n capture = false;\n }\n var documentTarget = useCallback(function () {\n return document;\n }, []);\n return useEventListener(documentTarget, event, handler, capture);\n}","map":{"version":3,"names":["useEventListener","useCallback","useGlobalListener","event","handler","capture","documentTarget","document"],"sources":["C:/Cours/SAE/SAE-3.01/Scripted/Scripted/website/node_modules/@restart/hooks/esm/useGlobalListener.js"],"sourcesContent":["import useEventListener from './useEventListener';\nimport { useCallback } from 'react';\n\n/**\n * Attaches an event handler outside directly to the `document`,\n * bypassing the react synthetic event system.\n *\n * ```ts\n * useGlobalListener('keydown', (event) => {\n * console.log(event.key)\n * })\n * ```\n *\n * @param event The DOM event name\n * @param handler An event handler\n * @param capture Whether or not to listen during the capture event phase\n */\nexport default function useGlobalListener(event, handler, capture) {\n if (capture === void 0) {\n capture = false;\n }\n\n var documentTarget = useCallback(function () {\n return document;\n }, []);\n return useEventListener(documentTarget, event, handler, capture);\n}"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,WAAW,QAAQ,OAAO;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiB,CAACC,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAE;EACjE,IAAIA,OAAO,KAAK,KAAK,CAAC,EAAE;IACtBA,OAAO,GAAG,KAAK;EACjB;EAEA,IAAIC,cAAc,GAAGL,WAAW,CAAC,YAAY;IAC3C,OAAOM,QAAQ;EACjB,CAAC,EAAE,EAAE,CAAC;EACN,OAAOP,gBAAgB,CAACM,cAAc,EAAEH,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC;AAClE"},"metadata":{},"sourceType":"module"}