package.cjs.react-utils.usePrevious.usePrevious.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":"usePrevious.js","names":["_react","require","usePrevious","value","ref","useRef","useEffect","current","_default","exports"],"sources":["../../../../src/react-utils/usePrevious/usePrevious.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nconst usePrevious = value => {\n const ref = useRef(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n\nexport default usePrevious;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAGC,KAAK,EAAI;EAC3B,IAAMC,GAAG,GAAG,IAAAC,aAAM,EAACF,KAAK,CAAC;EAEzB,IAAAG,gBAAS,EAAC,YAAM;IACdF,GAAG,CAACG,OAAO,GAAGJ,KAAK;EACrB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,OAAOC,GAAG,CAACG,OAAO;AACpB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaP,WAAW","ignoreList":[]}