gemi 0.37.0 → 0.38.0
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/app/index.js +1 -1
- package/dist/{chunk-s34ss7ej.js → chunk-871hrt5k.js} +21 -21
- package/dist/{chunk-s34ss7ej.js.map → chunk-871hrt5k.js.map} +5 -5
- package/dist/{chunk-mq07k1x9.js → chunk-pwhb292c.js} +1 -1
- package/dist/chunk-sbt387js.js +4 -0
- package/dist/{chunk-qps2yeaf.js.map → chunk-sbt387js.js.map} +3 -3
- package/dist/client/index.js +6 -19
- package/dist/client/index.js.map +1 -1
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/ApiRouter.d.ts +13 -1
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +5 -5
- package/dist/services/Singleton.d.ts +4 -0
- package/dist/services/Singleton.d.ts.map +1 -0
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/router/createFlatApiRoutes.test.d.ts +2 -0
- package/dist/services/router/createFlatApiRoutes.test.d.ts.map +1 -0
- package/dist/services/singleton/SingletonServiceContainer.d.ts +8 -0
- package/dist/services/singleton/SingletonServiceContainer.d.ts.map +1 -0
- package/dist/services/singleton/SingletonServiceProvider.d.ts +7 -0
- package/dist/services/singleton/SingletonServiceProvider.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-qps2yeaf.js +0 -4
- package/dist/services/Injectable.d.ts +0 -7
- package/dist/services/Injectable.d.ts.map +0 -1
- package/dist/services/custom-service/CustomServiceContainer.d.ts +0 -8
- package/dist/services/custom-service/CustomServiceContainer.d.ts.map +0 -1
- package/dist/services/custom-service/CustomServiceProvider.d.ts +0 -7
- package/dist/services/custom-service/CustomServiceProvider.d.ts.map +0 -1
- /package/dist/{chunk-mq07k1x9.js.map → chunk-pwhb292c.js.map} +0 -0
package/dist/client/index.js
CHANGED
|
@@ -260,20 +260,14 @@ function useQuery(url, ...args) {
|
|
|
260
260
|
const fallbackData = config.fallbackData ?? (prefetchedData == null ? void 0 : prefetchedData[normalPath]) ?? null;
|
|
261
261
|
const refreshInterval = config.refreshInterval;
|
|
262
262
|
const lazy2 = config.lazy;
|
|
263
|
-
const [resource, setResource] = useState(
|
|
264
|
-
() => getResource(normalPath, fallbackData)
|
|
265
|
-
);
|
|
263
|
+
const [resource, setResource] = useState(() => getResource(normalPath, fallbackData));
|
|
266
264
|
const configRef = useRef(config);
|
|
267
265
|
configRef.current = config;
|
|
268
|
-
const refreshIntervalRef = useRef(
|
|
269
|
-
null
|
|
270
|
-
);
|
|
266
|
+
const refreshIntervalRef = useRef(null);
|
|
271
267
|
const retryIntervalRef = useRef(null);
|
|
272
268
|
const retryingMap = useRef(/* @__PURE__ */ new Map());
|
|
273
269
|
const fetchedRef = useRef(!lazy2);
|
|
274
|
-
const refetchUntilTimerRef = useRef(
|
|
275
|
-
null
|
|
276
|
-
);
|
|
270
|
+
const refetchUntilTimerRef = useRef(null);
|
|
277
271
|
const refetchUntilDurationRef = useRef(0);
|
|
278
272
|
const prefetchedRef = useRef(false);
|
|
279
273
|
const [state, setState] = useState(() => {
|
|
@@ -352,10 +346,7 @@ function useQuery(url, ...args) {
|
|
|
352
346
|
setState(nextState);
|
|
353
347
|
}
|
|
354
348
|
if (cfg.refetchUntil && !nextState.loading && nextState.data && !nextState.error) {
|
|
355
|
-
const nextDuration = cfg.refetchUntil(
|
|
356
|
-
nextState.data,
|
|
357
|
-
refetchUntilDurationRef.current
|
|
358
|
-
);
|
|
349
|
+
const nextDuration = cfg.refetchUntil(nextState.data, refetchUntilDurationRef.current);
|
|
359
350
|
if (nextDuration > 0) {
|
|
360
351
|
refetchUntilDurationRef.current = nextDuration;
|
|
361
352
|
refetchUntilTimerRef.current = setTimeout(() => {
|
|
@@ -428,14 +419,10 @@ function useQuery(url, ...args) {
|
|
|
428
419
|
if (Array.isArray(updatedData)) {
|
|
429
420
|
return [...data, ...updatedData];
|
|
430
421
|
}
|
|
431
|
-
throw new Error(
|
|
432
|
-
"Mutate function must return an array when the current data is an array."
|
|
433
|
-
);
|
|
422
|
+
throw new Error("Mutate function must return an array when the current data is an array.");
|
|
434
423
|
}
|
|
435
424
|
if (typeof data !== typeof updatedData) {
|
|
436
|
-
throw new Error(
|
|
437
|
-
"Mutate function must return the same type as the current data."
|
|
438
|
-
);
|
|
425
|
+
throw new Error("Mutate function must return the same type as the current data.");
|
|
439
426
|
}
|
|
440
427
|
return updatedData;
|
|
441
428
|
});
|