"use client";
const require_shallow_equal = require("../utils/shallow-equal/shallow-equal.cjs");
let react = require("react");
//#region packages/@mantine/hooks/src/use-shallow-effect/use-shallow-effect.ts
function shallowCompare(prevValue, currValue) {
	if (!prevValue || !currValue) return false;
	if (prevValue === currValue) return true;
	if (prevValue.length !== currValue.length) return false;
	for (let i = 0; i < prevValue.length; i += 1) if (!require_shallow_equal.shallowEqual(prevValue[i], currValue[i])) return false;
	return true;
}
function useShallowCompare(dependencies) {
	const ref = (0, react.useRef)([]);
	const updateRef = (0, react.useRef)(0);
	if (!shallowCompare(ref.current, dependencies)) {
		ref.current = dependencies;
		updateRef.current += 1;
	}
	return [updateRef.current];
}
function useShallowEffect(cb, dependencies) {
	(0, react.useEffect)(cb, useShallowCompare(dependencies));
}
//#endregion
exports.useShallowEffect = useShallowEffect;

//# sourceMappingURL=use-shallow-effect.cjs.map