Skip to content

NVR with realtime local object detection for IP cameras

259 B
Raw Blame
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;
}