tsdf 17.0.0-alpha.18 → 17.0.0-alpha.19
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.js +4 -2
- package/docs/offset-pagination.md +1 -4
- package/docs/partial-resources.md +2 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -13938,8 +13938,10 @@ function useMultipleItems(items, { selector, loadFromStateOnly, returnIdleStatus
|
|
|
13938
13938
|
loadedFields
|
|
13939
13939
|
}, fields, partialResources.inferFields).length > 0) status = hasCachedDataInState && showPartialAsRefetching ? "refetching" : "loading";
|
|
13940
13940
|
} else if (partialResources && fields === "*" && (status === "success" || status === "refetching")) {
|
|
13941
|
-
|
|
13942
|
-
|
|
13941
|
+
const isIncomplete = !snapshotIsFullyLoaded(loadedFields, rawItemState, partialResources.inferFields) && !(itemsPendingFullInvalidation.has(itemKey) && hasCachedDataInState);
|
|
13942
|
+
const isStale = !isIncomplete && !snapshotIsFullyLoadedAndFresh(itemKey, loadedFields, rawItemState, partialResources.inferFields, itemsPendingFullInvalidation);
|
|
13943
|
+
if (isIncomplete) status = hasCachedDataInState && showPartialAsRefetching ? "refetching" : "loading";
|
|
13944
|
+
else if (isStale || itemFieldInvalidationFields && itemFieldInvalidationFields.length > 0) status = "refetching";
|
|
13943
13945
|
}
|
|
13944
13946
|
if (partialResources && showPartialAsRefetching) {
|
|
13945
13947
|
if (Array.isArray(fields) && fields.length > 0) {
|
|
@@ -17,10 +17,7 @@ const store = createListQueryStore<Task, TaskFilter, string, false, true>({
|
|
|
17
17
|
return api.getTasks(filter, { offset, limit, signal });
|
|
18
18
|
},
|
|
19
19
|
|
|
20
|
-
offsetPagination: {
|
|
21
|
-
maxInvalidationLimit: 200,
|
|
22
|
-
maxParallel: 3,
|
|
23
|
-
},
|
|
20
|
+
offsetPagination: { maxInvalidationLimit: 200, maxParallel: 3 },
|
|
24
21
|
|
|
25
22
|
// ...other options
|
|
26
23
|
});
|
|
@@ -139,6 +139,8 @@ When a hook requests fields that are partially loaded:
|
|
|
139
139
|
|
|
140
140
|
If you enable `showPartialAsRefetching`, the hook exposes `loadingFields` with the requested fields that are still pending. When cached partial data already exists, TSDF keeps it visible during the follow-up fetch.
|
|
141
141
|
|
|
142
|
+
Invalidations are refetches, not new loads: when an invalidation (full or per-field) marks cached data as stale, hooks whose requested fields are still present keep the stale data visible while the refetch is in flight (with a `refetching` status when `returnRefetchingStatus` is enabled). Data is only hidden behind `loading` when a requested field was genuinely never loaded.
|
|
143
|
+
|
|
142
144
|
## Fields in Scheduling and Fetching
|
|
143
145
|
|
|
144
146
|
Fields propagate through the scheduling and fetching APIs:
|