import { ref as e, watch as t } from "vue";
import { deepClone as n, isJsonEqual as r } from "@milaboratories/helpers";
/** Alternative to `watch`, but triggering only on actual data changes */
function i(i, a, o) {
	let s = e(), c = t(i, (e) => {
		r(e, s.value) || (s.value = n(e));
	}, {
		deep: !0,
		immediate: !0
	});
	return t(() => s.value, a, {
		deep: !0,
		immediate: o?.immediate
	}), c;
}
export { i as watchCached };

//# sourceMappingURL=watchCached.js.map