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.
1 line
2.1 KiB
1 line
2.1 KiB
2 years ago
|
{"ast":null,"code":"import { useEffect, useRef } from 'react';\nexport function useEventHandlers(element, eventHandlers) {\n const eventHandlersRef = useRef();\n useEffect(function addEventHandlers() {\n if (eventHandlers != null) {\n element.instance.on(eventHandlers);\n }\n\n eventHandlersRef.current = eventHandlers;\n return function removeEventHandlers() {\n if (eventHandlersRef.current != null) {\n element.instance.off(eventHandlersRef.current);\n }\n\n eventHandlersRef.current = null;\n };\n }, [element, eventHandlers]);\n}","map":{"version":3,"names":["useEffect","useRef","useEventHandlers","element","eventHandlers","eventHandlersRef","addEventHandlers","instance","on","current","removeEventHandlers","off"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/@react-leaflet/core/lib/events.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nexport function useEventHandlers(element, eventHandlers) {\n const eventHandlersRef = useRef();\n useEffect(function addEventHandlers() {\n if (eventHandlers != null) {\n element.instance.on(eventHandlers);\n }\n eventHandlersRef.current = eventHandlers;\n return function removeEventHandlers() {\n if (eventHandlersRef.current != null) {\n element.instance.off(eventHandlersRef.current);\n }\n eventHandlersRef.current = null;\n };\n }, [\n element,\n eventHandlers\n ]);\n}\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,OAAlC;AACA,OAAO,SAASC,gBAAT,CAA0BC,OAA1B,EAAmCC,aAAnC,EAAkD;EACrD,MAAMC,gBAAgB,GAAGJ,MAAM,EAA/B;EACAD,SAAS,CAAC,SAASM,gBAAT,GAA4B;IAClC,IAAIF,aAAa,IAAI,IAArB,EAA2B;MACvBD,OAAO,CAACI,QAAR,CAAiBC,EAAjB,CAAoBJ,aAApB;IACH;;IACDC,gBAAgB,CAACI,OAAjB,GAA2BL,aAA3B;IACA,OAAO,SAASM,mBAAT,GAA+B;MAClC,IAAIL,gBAAgB,CAACI,OAAjB,IAA4B,IAAhC,EAAsC;QAClCN,OAAO,CAACI,QAAR,CAAiBI,GAAjB,CAAqBN,gBAAgB,CAACI,OAAtC;MACH;;MACDJ,gBAAgB,CAACI,OAAjB,GAA2B,IAA3B;IACH,CALD;EAMH,CAXQ,EAWN,CACCN,OADD,EAECC,aAFD,CAXM,CAAT;AAeH"},"metadata":{},"sourceType":"module"}
|