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

package.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":["useEffect","useRef","useUpdateEffect","callback","dependencies","arguments","length","undefined","isInitialMount","current"],"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,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,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,GAAGP,MAAM,CAAC,IAAI,CAAC;EAEnCD,SAAS,CAAC,YAAM;IACd,IAAIQ,cAAc,CAACC,OAAO,EAAE;MAC1BD,cAAc,CAACC,OAAO,GAAG,KAAK;MAE9B;IACF;IACAN,QAAQ,CAAC,CAAC;EACZ,CAAC,EAAEC,YAAY,CAAC;AAClB,CAAC;AACD,eAAeF,eAAe","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy