@emeryld/rrroutes-client 2.8.1 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -645,11 +645,14 @@ function buildGetLeaf(leaf, rqOpts, env) {
645
645
  const mergedEnabled = mergedQueryOptions.enabled;
646
646
  const guardedEnabled = hasCompleteArgs && (typeof mergedEnabled === "undefined" ? true : mergedEnabled);
647
647
  const listenersRef = useRef2(/* @__PURE__ */ new Set());
648
- const notifyOnReceive = useCallback2((data) => {
649
- buildOnReceive2?.(data);
650
- useOnReceive?.(data);
651
- listenersRef.current.forEach((listener) => listener(data));
652
- }, [buildOnReceive2, useOnReceive]);
648
+ const notifyOnReceive = useCallback2(
649
+ (data) => {
650
+ buildOnReceive2?.(data);
651
+ useOnReceive?.(data);
652
+ listenersRef.current.forEach((listener) => listener(data));
653
+ },
654
+ [buildOnReceive2, useOnReceive]
655
+ );
653
656
  const registerOnReceive = useCallback2(
654
657
  (listener) => {
655
658
  listenersRef.current.add(listener);
@@ -1313,7 +1316,6 @@ function buildMutationLeaf(leaf, rqOpts, env) {
1313
1316
  }
1314
1317
 
1315
1318
  // src/routesV3.client.ts
1316
- var BUILT_LEAF_META = "__rrroutesLeaf";
1317
1319
  var defaultDebugLogger = (event) => {
1318
1320
  if (typeof console === "undefined") return;
1319
1321
  const fn = console.debug ?? console.log;
@@ -1397,7 +1399,7 @@ function createRouteClient(opts) {
1397
1399
  }
1398
1400
  const toArgsTuple2 = (args) => typeof args === "undefined" ? [] : [args];
1399
1401
  const getBuiltLeaf = (built) => {
1400
- const leaf = built[BUILT_LEAF_META];
1402
+ const leaf = built["__rrroutesLeaf"];
1401
1403
  if (!leaf) {
1402
1404
  throw new Error(
1403
1405
  "buildBranch(...) expects endpoints created with this route client via client.build(...)."
@@ -1442,18 +1444,12 @@ function createRouteClient(opts) {
1442
1444
  env
1443
1445
  );
1444
1446
  }
1445
- Object.defineProperty(built, BUILT_LEAF_META, {
1447
+ Object.defineProperty(built, "__rrroutesLeaf", {
1446
1448
  value: leaf,
1447
1449
  enumerable: false,
1448
1450
  configurable: false,
1449
1451
  writable: false
1450
1452
  });
1451
- Object.defineProperty(built, "metadata", {
1452
- value: { leaf },
1453
- enumerable: true,
1454
- configurable: false,
1455
- writable: false
1456
- });
1457
1453
  return built;
1458
1454
  }
1459
1455
  const fetchRaw = async (input) => {