@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
13 lines • 387 B
JavaScript
import deepEqual from "fast-deep-equal";
import { useRef } from "react";
/**
* Memoization that works with deep equal for objects we don't know the exact structure of
*/
export function useDeepEqualMemo(value) {
const ref = useRef();
if (!deepEqual(ref.current, value)) {
ref.current = value;
}
return ref.current;
}
//# sourceMappingURL=useDeepEqualMemo.js.map