tsdf 16.0.0 → 16.0.1

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/main.cjs CHANGED
@@ -2413,12 +2413,13 @@ function useListItemIsLoading({
2413
2413
  loadItemFallback,
2414
2414
  itemId
2415
2415
  }) {
2416
- const [willBeRefetched, setWillBeRefetched] = (0, import_react11.useState)(itemExists);
2416
+ const isNotFound = !itemExists;
2417
+ const [willBeRefetched, setWillBeRefetched] = (0, import_react11.useState)(isNotFound);
2417
2418
  const resetWillBeRefechedTimeout = useTimeout(1e3);
2418
2419
  const callFallbackLoadItemTimeout = useTimeout(100);
2419
2420
  const ignoreSetWillBeRefetched = (0, import_react11.useRef)(false);
2420
2421
  const itemWasRefetched = useConst(() => /* @__PURE__ */ new Set());
2421
- if (itemExists && !isRefetching && !willBeRefetched && !ignoreSetWillBeRefetched.current && itemId && !itemWasRefetched.has(itemId)) {
2422
+ if (isNotFound && !isRefetching && !willBeRefetched && !ignoreSetWillBeRefetched.current && itemId && !itemWasRefetched.has(itemId)) {
2422
2423
  setWillBeRefetched(true);
2423
2424
  }
2424
2425
  const latestIsLoadingOrRefetching = useLatestValue(
@@ -2467,7 +2468,7 @@ function useListItemIsLoading({
2467
2468
  latestLoadItemFallback,
2468
2469
  callFallbackLoadItemTimeout
2469
2470
  ]);
2470
- return listIsLoading || itemExists && (isRefetching || !!willBeRefetched);
2471
+ return listIsLoading || isNotFound && (isRefetching || !!willBeRefetched);
2471
2472
  }
2472
2473
 
2473
2474
  // src/useListItemIsDeleted.ts
package/dist/main.js CHANGED
@@ -2382,12 +2382,13 @@ function useListItemIsLoading({
2382
2382
  loadItemFallback,
2383
2383
  itemId
2384
2384
  }) {
2385
- const [willBeRefetched, setWillBeRefetched] = useState2(itemExists);
2385
+ const isNotFound = !itemExists;
2386
+ const [willBeRefetched, setWillBeRefetched] = useState2(isNotFound);
2386
2387
  const resetWillBeRefechedTimeout = useTimeout(1e3);
2387
2388
  const callFallbackLoadItemTimeout = useTimeout(100);
2388
2389
  const ignoreSetWillBeRefetched = useRef2(false);
2389
2390
  const itemWasRefetched = useConst(() => /* @__PURE__ */ new Set());
2390
- if (itemExists && !isRefetching && !willBeRefetched && !ignoreSetWillBeRefetched.current && itemId && !itemWasRefetched.has(itemId)) {
2391
+ if (isNotFound && !isRefetching && !willBeRefetched && !ignoreSetWillBeRefetched.current && itemId && !itemWasRefetched.has(itemId)) {
2391
2392
  setWillBeRefetched(true);
2392
2393
  }
2393
2394
  const latestIsLoadingOrRefetching = useLatestValue(
@@ -2436,7 +2437,7 @@ function useListItemIsLoading({
2436
2437
  latestLoadItemFallback,
2437
2438
  callFallbackLoadItemTimeout
2438
2439
  ]);
2439
- return listIsLoading || itemExists && (isRefetching || !!willBeRefetched);
2440
+ return listIsLoading || isNotFound && (isRefetching || !!willBeRefetched);
2440
2441
  }
2441
2442
 
2442
2443
  // src/useListItemIsDeleted.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdf",
3
- "version": "16.0.0",
3
+ "version": "16.0.1",
4
4
  "description": "A data fetching solution based on t-state",
5
5
  "license": "MIT",
6
6
  "author": "Lucas Santos",