All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.useFuncDebounce.useFuncDebounce.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"useFuncDebounce.js","names":["_react","require","useFuncDebounce","func","delay","arguments","length","undefined","timer","useRef","debouncedFunc","_len","args","Array","_key","clearTimeout","current","setTimeout","apply","cancel","_default","exports"],"sources":["../../../../src/react-utils/useFuncDebounce/useFuncDebounce.js"],"sourcesContent":["import { useRef } from \"react\";\n\nconst useFuncDebounce = (func, delay = 350) => {\n  const timer = useRef(null);\n  const debouncedFunc = (...args) => {\n    clearTimeout(timer.current);\n    timer.current = setTimeout(() => func(...args), delay);\n  };\n  debouncedFunc.cancel = () => clearTimeout(timer.current);\n\n  return debouncedFunc;\n};\n\nexport default useFuncDebounce;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAAI,EAAkB;EAAA,IAAhBC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EACxC,IAAMG,KAAK,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAC1B,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA,EAAgB;IAAA,SAAAC,IAAA,GAAAN,SAAA,CAAAC,MAAA,EAATM,IAAI,OAAAC,KAAA,CAAAF,IAAA,GAAAG,IAAA,MAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAT,SAAA,CAAAS,IAAA;IAAA;IAC5BC,YAAY,CAACP,KAAK,CAACQ,OAAO,CAAC;IAC3BR,KAAK,CAACQ,OAAO,GAAGC,UAAU,CAAC;MAAA,OAAMd,IAAI,CAAAe,KAAA,SAAIN,IAAI,CAAC;IAAA,GAAER,KAAK,CAAC;EACxD,CAAC;EACDM,aAAa,CAACS,MAAM,GAAG;IAAA,OAAMJ,YAAY,CAACP,KAAK,CAACQ,OAAO,CAAC;EAAA;EAExD,OAAON,aAAa;AACtB,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,cAEanB,eAAe","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy