import { useCallback as u } from "react";
function l(n, o) {
  return n !== null && o !== null && typeof n == "object" && typeof o == "object" && "id" in n && "id" in o ? n.id === o.id : n === o;
}
function f(n = l) {
  return u((o, t) => {
    if (typeof n == "string") {
      let i = n;
      return (o == null ? void 0 : o[i]) === (t == null ? void 0 : t[i]);
    }
    return n(o, t);
  }, [n]);
}
export {
  f as useByComparator
};
