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

package.cjs.react-utils.useUpdateEffect.useUpdateEffect.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":"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":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy