package.cjs.react-utils.useUpdateEffect.useUpdateEffect.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"useUpdateEffect.js","names":["_react","require","useUpdateEffect","callback","dependencies","arguments","length","undefined","isInitialMount","useRef","useEffect","current","_default","exports"],"sources":["../../../../src/react-utils/useUpdateEffect/useUpdateEffect.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nconst useUpdateEffect = (callback, dependencies = []) => {\n const isInitialMount = useRef(true);\n\n useEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n\n return;\n }\n callback();\n }, dependencies);\n};\nexport default useUpdateEffect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,QAAQ,EAAwB;EAAA,IAAtBC,YAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAClD,IAAMG,cAAc,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAEnC,IAAAC,gBAAS,EAAC,YAAM;IACd,IAAIF,cAAc,CAACG,OAAO,EAAE;MAC1BH,cAAc,CAACG,OAAO,GAAG,KAAK;MAE9B;IACF;IACAR,QAAQ,CAAC,CAAC;EACZ,CAAC,EAAEC,YAAY,CAAC;AAClB,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cACaX,eAAe","ignoreList":[]}