@ventlio/tanstack-query 0.2.43 → 0.2.45
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/index.mjs
CHANGED
|
@@ -279,20 +279,14 @@ const useGetRequest = ({ path, load = false, queryOptions, keyTracker, }) => {
|
|
|
279
279
|
}, [path]);
|
|
280
280
|
useEffect(() => {
|
|
281
281
|
if (keyTracker) {
|
|
282
|
+
// set expiration time for the tracker
|
|
282
283
|
queryClient.setQueryDefaults([keyTracker], {
|
|
283
|
-
staleTime: Infinity,
|
|
284
284
|
cacheTime: Infinity,
|
|
285
|
+
staleTime: Infinity,
|
|
285
286
|
});
|
|
286
287
|
queryClient.setQueryData([keyTracker], [requestPath, {}]);
|
|
287
288
|
}
|
|
288
|
-
}, [keyTracker, requestPath, queryClient]);
|
|
289
|
-
useEffect(() => {
|
|
290
|
-
console.log({
|
|
291
|
-
isStale: query.isStale,
|
|
292
|
-
query: [requestPath, {}],
|
|
293
|
-
});
|
|
294
|
-
if (query.isStale && keyTracker) ;
|
|
295
|
-
}, [query.isStale, keyTracker, queryClient, requestPath]);
|
|
289
|
+
}, [keyTracker, requestPath, queryClient, queryOptions?.staleTime]);
|
|
296
290
|
const nextPage = () => {
|
|
297
291
|
if (query.data?.data.pagination) {
|
|
298
292
|
const pagination = query.data.data.pagination;
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -46,20 +46,14 @@ const useGetRequest = ({ path, load = false, queryOptions, keyTracker, }) => {
|
|
|
46
46
|
}, [path]);
|
|
47
47
|
react.useEffect(() => {
|
|
48
48
|
if (keyTracker) {
|
|
49
|
+
// set expiration time for the tracker
|
|
49
50
|
queryClient.setQueryDefaults([keyTracker], {
|
|
50
|
-
staleTime: Infinity,
|
|
51
51
|
cacheTime: Infinity,
|
|
52
|
+
staleTime: Infinity,
|
|
52
53
|
});
|
|
53
54
|
queryClient.setQueryData([keyTracker], [requestPath, {}]);
|
|
54
55
|
}
|
|
55
|
-
}, [keyTracker, requestPath, queryClient]);
|
|
56
|
-
react.useEffect(() => {
|
|
57
|
-
console.log({
|
|
58
|
-
isStale: query.isStale,
|
|
59
|
-
query: [requestPath, {}],
|
|
60
|
-
});
|
|
61
|
-
if (query.isStale && keyTracker) ;
|
|
62
|
-
}, [query.isStale, keyTracker, queryClient, requestPath]);
|
|
56
|
+
}, [keyTracker, requestPath, queryClient, queryOptions?.staleTime]);
|
|
63
57
|
const nextPage = () => {
|
|
64
58
|
if (query.data?.data.pagination) {
|
|
65
59
|
const pagination = query.data.data.pagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetRequest.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGetRequest.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -76,26 +76,15 @@ export const useGetRequest = <TResponse extends Record<string, any>>({
|
|
|
76
76
|
|
|
77
77
|
useEffect(() => {
|
|
78
78
|
if (keyTracker) {
|
|
79
|
+
// set expiration time for the tracker
|
|
79
80
|
queryClient.setQueryDefaults([keyTracker], {
|
|
80
|
-
staleTime: Infinity,
|
|
81
81
|
cacheTime: Infinity,
|
|
82
|
+
staleTime: Infinity,
|
|
82
83
|
});
|
|
83
|
-
queryClient.setQueryData([keyTracker], [requestPath, {}]);
|
|
84
|
-
}
|
|
85
|
-
}, [keyTracker, requestPath, queryClient]);
|
|
86
84
|
|
|
87
|
-
|
|
88
|
-
console.log({
|
|
89
|
-
isStale: query.isStale,
|
|
90
|
-
query: [requestPath, {}],
|
|
91
|
-
});
|
|
92
|
-
if (query.isStale && keyTracker) {
|
|
93
|
-
// queryClient.removeQueries({
|
|
94
|
-
// queryKey: [keyTracker],
|
|
95
|
-
// exact: true,
|
|
96
|
-
// });
|
|
85
|
+
queryClient.setQueryData([keyTracker], [requestPath, {}]);
|
|
97
86
|
}
|
|
98
|
-
}, [
|
|
87
|
+
}, [keyTracker, requestPath, queryClient, queryOptions?.staleTime]);
|
|
99
88
|
|
|
100
89
|
const nextPage = () => {
|
|
101
90
|
if (query.data?.data.pagination) {
|