@spoosh/plugin-optimistic 0.3.0 → 0.4.0
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -225,9 +225,9 @@ declare const OPTIMISTIC_SNAPSHOTS_KEY = "optimistic:snapshots";
|
|
|
225
225
|
* Immediately updates cached data before the mutation completes,
|
|
226
226
|
* with automatic rollback on error.
|
|
227
227
|
*
|
|
228
|
-
* When using optimistic updates,
|
|
228
|
+
* When using optimistic updates, invalidation mode defaults to `"none"` to prevent
|
|
229
229
|
* unnecessary refetches that would override the optimistic data. You can override
|
|
230
|
-
* this by explicitly setting `
|
|
230
|
+
* this by explicitly setting the `invalidate` option with a mode string or array.
|
|
231
231
|
*
|
|
232
232
|
* @see {@link https://spoosh.dev/docs/plugins/optimistic | Optimistic Plugin Documentation}
|
|
233
233
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -225,9 +225,9 @@ declare const OPTIMISTIC_SNAPSHOTS_KEY = "optimistic:snapshots";
|
|
|
225
225
|
* Immediately updates cached data before the mutation completes,
|
|
226
226
|
* with automatic rollback on error.
|
|
227
227
|
*
|
|
228
|
-
* When using optimistic updates,
|
|
228
|
+
* When using optimistic updates, invalidation mode defaults to `"none"` to prevent
|
|
229
229
|
* unnecessary refetches that would override the optimistic data. You can override
|
|
230
|
-
* this by explicitly setting `
|
|
230
|
+
* this by explicitly setting the `invalidate` option with a mode string or array.
|
|
231
231
|
*
|
|
232
232
|
* @see {@link https://spoosh.dev/docs/plugins/optimistic | Optimistic Plugin Documentation}
|
|
233
233
|
*
|
package/dist/index.js
CHANGED
|
@@ -162,7 +162,7 @@ function optimisticPlugin() {
|
|
|
162
162
|
const { stateManager } = context;
|
|
163
163
|
const targets = resolveOptimisticTargets(context);
|
|
164
164
|
if (targets.length > 0) {
|
|
165
|
-
context.plugins.get("spoosh:invalidation")?.
|
|
165
|
+
context.plugins.get("spoosh:invalidation")?.setDefaultMode("none");
|
|
166
166
|
}
|
|
167
167
|
const immediateTargets = targets.filter((t) => t.timing !== "onSuccess");
|
|
168
168
|
const allSnapshots = [];
|
package/dist/index.mjs
CHANGED
|
@@ -135,7 +135,7 @@ function optimisticPlugin() {
|
|
|
135
135
|
const { stateManager } = context;
|
|
136
136
|
const targets = resolveOptimisticTargets(context);
|
|
137
137
|
if (targets.length > 0) {
|
|
138
|
-
context.plugins.get("spoosh:invalidation")?.
|
|
138
|
+
context.plugins.get("spoosh:invalidation")?.setDefaultMode("none");
|
|
139
139
|
}
|
|
140
140
|
const immediateTargets = targets.filter((t) => t.timing !== "onSuccess");
|
|
141
141
|
const allSnapshots = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-optimistic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Optimistic updates plugin for Spoosh - instant UI updates with automatic rollback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@spoosh/core": ">=0.6.0",
|
|
37
|
-
"@spoosh/plugin-invalidation": ">=0.
|
|
37
|
+
"@spoosh/plugin-invalidation": ">=0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@spoosh/core": "0.6.0",
|
|
41
|
-
"@spoosh/plugin-invalidation": "0.
|
|
41
|
+
"@spoosh/plugin-invalidation": "0.4.0",
|
|
42
42
|
"@spoosh/test-utils": "0.1.5"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|