import { useMemo, useRef } from "react";
// Generic type for the return value of the memoized factory
export function useMemoWithDebug(factory, dependencies) {
    const previousDependenciesRef = useRef([]);
    const hasChanged = dependencies.some((dep, index) => {
        return dep !== previousDependenciesRef.current[index];
    });
    if (hasChanged) {
        dependencies.forEach((dep, index) => {
            if (dep !== previousDependenciesRef.current[index]) {
                console.log(`Dependency at index ${index} changed:`, "\nPrevious:", previousDependenciesRef.current[index], "\nCurrent:", dep);
            }
        });
    }
    previousDependenciesRef.current = dependencies;
    return useMemo(factory, dependencies);
}
//# sourceMappingURL=useMemoDebug.js.map