tanstack-cacher 1.4.2 → 1.4.4
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/index.d.ts +1 -1
- package/index.js +3 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -82,14 +82,13 @@ var DEFAULT_PAGINATION_PATHS = {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
// src/managers/QueryCacheManager/QueryCache.manager.ts
|
|
85
|
-
var defaultQueryClient = new reactQuery.QueryClient();
|
|
86
85
|
var QueryCacheManager = class {
|
|
87
86
|
constructor(config) {
|
|
88
87
|
const isPaginated = Boolean(config.pagination);
|
|
89
88
|
this.config = {
|
|
90
89
|
...config,
|
|
91
90
|
itemsPath: config.itemsPath ?? "data.content",
|
|
92
|
-
queryClient: config.queryClient
|
|
91
|
+
queryClient: config.queryClient,
|
|
93
92
|
isPaginated,
|
|
94
93
|
keyExtractor: config.keyExtractor || ((item) => item.id),
|
|
95
94
|
pagination: isPaginated ? {
|
|
@@ -420,13 +419,14 @@ var useCustomMutation = (options) => {
|
|
|
420
419
|
...rest
|
|
421
420
|
} = options;
|
|
422
421
|
const cacherContext = useCacherContext();
|
|
422
|
+
const queryClient = reactQuery.useQueryClient();
|
|
423
423
|
const shouldNotifyError = notify || notifyError;
|
|
424
424
|
const shouldNotifySuccess = notify || notifySuccess;
|
|
425
425
|
const cacheActionsToRun = Array.isArray(cacheActions) ? cacheActions : cacheActions ? [cacheActions] : [];
|
|
426
426
|
const runCacheActions = (data) => {
|
|
427
427
|
cacheActionsToRun.forEach((action) => {
|
|
428
428
|
const { type, ...config } = action;
|
|
429
|
-
const manager = cacheManagerFactory.create(config);
|
|
429
|
+
const manager = cacheManagerFactory.create({ ...config, queryClient });
|
|
430
430
|
runCacheManagers(type, manager, data);
|
|
431
431
|
});
|
|
432
432
|
};
|
package/package.json
CHANGED