tanstack-cacher 1.6.0 → 1.6.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.
Files changed (2) hide show
  1. package/index.js +4 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -272,6 +272,10 @@ var QueryCacheManager = class {
272
272
  try {
273
273
  this.config.queryClient.setQueryData(this.config.queryKey, (oldData) => {
274
274
  if (!oldData) return oldData;
275
+ if (!updater) {
276
+ this.invalidate();
277
+ return oldData;
278
+ }
275
279
  const current = getAtPath(oldData, path, []);
276
280
  const safeCurrent = Array.isArray(current) ? current : [];
277
281
  let updatedItems;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanstack-cacher",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A lightweight cache management utility for TanStack Query that simplifies adding, updating, deleting, and synchronizing cached data",
5
5
  "license": "MIT",
6
6
  "repository": {