@emeryld/rrroutes-client 2.8.2 → 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/README.md +0 -2
- package/dist/index.cjs +10 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -14
- package/dist/index.mjs.map +1 -1
- package/dist/routesV3.client.batch.d.ts +3 -3
- package/dist/routesV3.client.d.ts +3 -3
- package/dist/routesV3.client.get.d.ts +2 -2
- package/dist/routesV3.client.infiniteGet.d.ts +2 -2
- package/dist/routesV3.client.mutation.d.ts +2 -2
- package/dist/routesV3.client.types.d.ts +41 -44
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,8 +108,6 @@ const result = users.useEndpoint()
|
|
|
108
108
|
// result.error is now typed as HttpError | null
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
You can still override per-client by passing `createRouteClient<Names, TError>(...)` when needed.
|
|
112
|
-
|
|
113
111
|
### 2) Build endpoints from your registry
|
|
114
112
|
|
|
115
113
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -680,11 +680,14 @@ function buildGetLeaf(leaf, rqOpts, env) {
|
|
|
680
680
|
const mergedEnabled = mergedQueryOptions.enabled;
|
|
681
681
|
const guardedEnabled = hasCompleteArgs && (typeof mergedEnabled === "undefined" ? true : mergedEnabled);
|
|
682
682
|
const listenersRef = (0, import_react2.useRef)(/* @__PURE__ */ new Set());
|
|
683
|
-
const notifyOnReceive = (0, import_react2.useCallback)(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
683
|
+
const notifyOnReceive = (0, import_react2.useCallback)(
|
|
684
|
+
(data) => {
|
|
685
|
+
buildOnReceive2?.(data);
|
|
686
|
+
useOnReceive?.(data);
|
|
687
|
+
listenersRef.current.forEach((listener) => listener(data));
|
|
688
|
+
},
|
|
689
|
+
[buildOnReceive2, useOnReceive]
|
|
690
|
+
);
|
|
688
691
|
const registerOnReceive = (0, import_react2.useCallback)(
|
|
689
692
|
(listener) => {
|
|
690
693
|
listenersRef.current.add(listener);
|
|
@@ -1343,7 +1346,6 @@ function buildMutationLeaf(leaf, rqOpts, env) {
|
|
|
1343
1346
|
}
|
|
1344
1347
|
|
|
1345
1348
|
// src/routesV3.client.ts
|
|
1346
|
-
var BUILT_LEAF_META = "__rrroutesLeaf";
|
|
1347
1349
|
var defaultDebugLogger = (event) => {
|
|
1348
1350
|
if (typeof console === "undefined") return;
|
|
1349
1351
|
const fn = console.debug ?? console.log;
|
|
@@ -1427,7 +1429,7 @@ function createRouteClient(opts) {
|
|
|
1427
1429
|
}
|
|
1428
1430
|
const toArgsTuple2 = (args) => typeof args === "undefined" ? [] : [args];
|
|
1429
1431
|
const getBuiltLeaf = (built) => {
|
|
1430
|
-
const leaf = built[
|
|
1432
|
+
const leaf = built["__rrroutesLeaf"];
|
|
1431
1433
|
if (!leaf) {
|
|
1432
1434
|
throw new Error(
|
|
1433
1435
|
"buildBranch(...) expects endpoints created with this route client via client.build(...)."
|
|
@@ -1472,18 +1474,12 @@ function createRouteClient(opts) {
|
|
|
1472
1474
|
env
|
|
1473
1475
|
);
|
|
1474
1476
|
}
|
|
1475
|
-
Object.defineProperty(built,
|
|
1477
|
+
Object.defineProperty(built, "__rrroutesLeaf", {
|
|
1476
1478
|
value: leaf,
|
|
1477
1479
|
enumerable: false,
|
|
1478
1480
|
configurable: false,
|
|
1479
1481
|
writable: false
|
|
1480
1482
|
});
|
|
1481
|
-
Object.defineProperty(built, "metadata", {
|
|
1482
|
-
value: { leaf },
|
|
1483
|
-
enumerable: true,
|
|
1484
|
-
configurable: false,
|
|
1485
|
-
writable: false
|
|
1486
|
-
});
|
|
1487
1483
|
return built;
|
|
1488
1484
|
}
|
|
1489
1485
|
const fetchRaw = async (input) => {
|