mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 10:00:17 -04:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
12 lines
317 B
JavaScript
12 lines
317 B
JavaScript
import { isEqual } from "lodash";
|
|
import { useMemo, useRef } from "react";
|
|
|
|
export default function useMemoWithDeepCompare(create, inputs) {
|
|
const valueRef = useRef();
|
|
const value = useMemo(create, inputs);
|
|
if (!isEqual(value, valueRef.current)) {
|
|
valueRef.current = value;
|
|
}
|
|
return valueRef.current;
|
|
}
|