forked from Github/frigate
Add status bar provider (#11066)
This commit is contained in:
12
web/src/hooks/use-deep-memo.ts
Normal file
12
web/src/hooks/use-deep-memo.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { useRef } from "react";
|
||||
import { isEqual } from "lodash";
|
||||
|
||||
export default function useDeepMemo<T>(value: T) {
|
||||
const ref = useRef<T | undefined>(undefined);
|
||||
|
||||
if (!isEqual(ref.current, value)) {
|
||||
ref.current = value;
|
||||
}
|
||||
|
||||
return ref.current;
|
||||
}
|
||||
Reference in New Issue
Block a user