UNPKG

@frontify/fondue

Version:
14 lines (13 loc) 644 B
import { useRef as r, useEffect as s } from "react"; import i from "react-fast-compare"; const n = (t) => t !== Object(t), u = (t, e) => { process.env.NODE_ENV !== "production" && ((!e || e.length === 0) && console.warn("`useDeepCompareEffect` should not be used with no dependencies. Use `useEffect` instead."), e.every(n) && console.warn( "`useDeepCompareEffect` should not be used with dependencies that are all primitive values. Use `useEffect` instead." )); const o = r(void 0); i(e, o.current) || (o.current = e), s(t, o.current); }; export { u as useDeepCompareEffect }; //# sourceMappingURL=useDeepCompareEffect.es.js.map