bigbluebutton-Github/bigbluebutton-html5/imports/ui/hooks/useDeepComparison.ts

11 lines
314 B
TypeScript
Raw Normal View History

import { isEqual } from 'radash';
import usePreviousValue from './usePreviousValue';
export const useDeepComparison = (...args: unknown[]) => {
const prev = usePreviousValue(args);
if (!prev) return true;
return args.some((item, index) => !isEqual(item, prev[index]));
};
export default useDeepComparison;