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.
Files changed (37) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/{chunk-s34ss7ej.js → chunk-871hrt5k.js} +21 -21
  3. package/dist/{chunk-s34ss7ej.js.map → chunk-871hrt5k.js.map} +5 -5
  4. package/dist/{chunk-mq07k1x9.js → chunk-pwhb292c.js} +1 -1
  5. package/dist/chunk-sbt387js.js +4 -0
  6. package/dist/{chunk-qps2yeaf.js.map → chunk-sbt387js.js.map} +3 -3
  7. package/dist/client/index.js +6 -19
  8. package/dist/client/index.js.map +1 -1
  9. package/dist/client/useQuery.d.ts.map +1 -1
  10. package/dist/facades/index.js +1 -1
  11. package/dist/http/ApiRouter.d.ts +13 -1
  12. package/dist/http/ApiRouter.d.ts.map +1 -1
  13. package/dist/http/index.js +1 -1
  14. package/dist/i18n/index.js +1 -1
  15. package/dist/kernel/index.js +2 -2
  16. package/dist/kernel/index.js.map +5 -5
  17. package/dist/services/Singleton.d.ts +4 -0
  18. package/dist/services/Singleton.d.ts.map +1 -0
  19. package/dist/services/index.d.ts +3 -3
  20. package/dist/services/index.d.ts.map +1 -1
  21. package/dist/services/index.js +2 -2
  22. package/dist/services/index.js.map +1 -1
  23. package/dist/services/router/createFlatApiRoutes.test.d.ts +2 -0
  24. package/dist/services/router/createFlatApiRoutes.test.d.ts.map +1 -0
  25. package/dist/services/singleton/SingletonServiceContainer.d.ts +8 -0
  26. package/dist/services/singleton/SingletonServiceContainer.d.ts.map +1 -0
  27. package/dist/services/singleton/SingletonServiceProvider.d.ts +7 -0
  28. package/dist/services/singleton/SingletonServiceProvider.d.ts.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/chunk-qps2yeaf.js +0 -4
  31. package/dist/services/Injectable.d.ts +0 -7
  32. package/dist/services/Injectable.d.ts.map +0 -1
  33. package/dist/services/custom-service/CustomServiceContainer.d.ts +0 -8
  34. package/dist/services/custom-service/CustomServiceContainer.d.ts.map +0 -1
  35. package/dist/services/custom-service/CustomServiceProvider.d.ts +0 -7
  36. package/dist/services/custom-service/CustomServiceProvider.d.ts.map +0 -1
  37. /package/dist/{chunk-mq07k1x9.js.map → chunk-pwhb292c.js.map} +0 -0
@@ -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
  });