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

package.react-utils.usePrevious.usePrevious.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":"usePrevious.js","names":["useEffect","useRef","usePrevious","value","ref","current"],"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,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAGC,KAAK,EAAI;EAC3B,IAAMC,GAAG,GAAGH,MAAM,CAACE,KAAK,CAAC;EAEzBH,SAAS,CAAC,YAAM;IACdI,GAAG,CAACC,OAAO,GAAGF,KAAK;EACrB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,OAAOC,GAAG,CAACC,OAAO;AACpB,CAAC;AAED,eAAeH,WAAW"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy