@spoosh/plugin-optimistic 0.6.1 → 0.7.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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -203,7 +203,7 @@ interface OptimisticWriteTriggerOptions<TSchema = unknown, TResponse = unknown>
|
|
|
203
203
|
optimistic?: OptimisticCallbackFn<TSchema, TResponse>;
|
|
204
204
|
}
|
|
205
205
|
type OptimisticReadOptions = object;
|
|
206
|
-
type
|
|
206
|
+
type OptimisticPagesOptions = object;
|
|
207
207
|
interface OptimisticReadResult {
|
|
208
208
|
isOptimistic: boolean;
|
|
209
209
|
}
|
|
@@ -218,9 +218,9 @@ declare function optimisticPlugin(): SpooshPlugin<{
|
|
|
218
218
|
readOptions: OptimisticReadOptions;
|
|
219
219
|
writeOptions: OptimisticWriteOptions;
|
|
220
220
|
writeTriggerOptions: OptimisticWriteTriggerOptions;
|
|
221
|
-
|
|
221
|
+
pagesOptions: OptimisticPagesOptions;
|
|
222
222
|
readResult: OptimisticReadResult;
|
|
223
223
|
writeResult: OptimisticWriteResult;
|
|
224
224
|
}>;
|
|
225
225
|
|
|
226
|
-
export { type AnyOptimisticTarget, type OptimisticApiHelper, type OptimisticBuilder, type OptimisticCallbackFn, type
|
|
226
|
+
export { type AnyOptimisticTarget, type OptimisticApiHelper, type OptimisticBuilder, type OptimisticCallbackFn, type OptimisticPagesOptions, type OptimisticPluginConfig, type OptimisticReadOptions, type OptimisticReadResult, type OptimisticTarget, type OptimisticWriteOptions, type OptimisticWriteResult, type OptimisticWriteTriggerOptions, optimisticPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -203,7 +203,7 @@ interface OptimisticWriteTriggerOptions<TSchema = unknown, TResponse = unknown>
|
|
|
203
203
|
optimistic?: OptimisticCallbackFn<TSchema, TResponse>;
|
|
204
204
|
}
|
|
205
205
|
type OptimisticReadOptions = object;
|
|
206
|
-
type
|
|
206
|
+
type OptimisticPagesOptions = object;
|
|
207
207
|
interface OptimisticReadResult {
|
|
208
208
|
isOptimistic: boolean;
|
|
209
209
|
}
|
|
@@ -218,9 +218,9 @@ declare function optimisticPlugin(): SpooshPlugin<{
|
|
|
218
218
|
readOptions: OptimisticReadOptions;
|
|
219
219
|
writeOptions: OptimisticWriteOptions;
|
|
220
220
|
writeTriggerOptions: OptimisticWriteTriggerOptions;
|
|
221
|
-
|
|
221
|
+
pagesOptions: OptimisticPagesOptions;
|
|
222
222
|
readResult: OptimisticReadResult;
|
|
223
223
|
writeResult: OptimisticWriteResult;
|
|
224
224
|
}>;
|
|
225
225
|
|
|
226
|
-
export { type AnyOptimisticTarget, type OptimisticApiHelper, type OptimisticBuilder, type OptimisticCallbackFn, type
|
|
226
|
+
export { type AnyOptimisticTarget, type OptimisticApiHelper, type OptimisticBuilder, type OptimisticCallbackFn, type OptimisticPagesOptions, type OptimisticPluginConfig, type OptimisticReadOptions, type OptimisticReadResult, type OptimisticTarget, type OptimisticWriteOptions, type OptimisticWriteResult, type OptimisticWriteTriggerOptions, optimisticPlugin };
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,6 @@ function getMatchingEntries(stateManager, targetPath, targetMethod) {
|
|
|
147
147
|
if (hasPatternParams(targetPath)) {
|
|
148
148
|
const allEntries = stateManager.getAllCacheEntries();
|
|
149
149
|
for (const { key, entry } of allEntries) {
|
|
150
|
-
if (key.includes('"type":"infinite-tracker"')) continue;
|
|
151
150
|
if (!key.includes(`"method":"${targetMethod}"`)) continue;
|
|
152
151
|
const actualPath = extractPathFromKey(key);
|
|
153
152
|
if (!actualPath) continue;
|
|
@@ -162,7 +161,6 @@ function getMatchingEntries(stateManager, targetPath, targetMethod) {
|
|
|
162
161
|
} else {
|
|
163
162
|
const allEntries = stateManager.getAllCacheEntries();
|
|
164
163
|
for (const { key, entry } of allEntries) {
|
|
165
|
-
if (key.includes('"type":"infinite-tracker"')) continue;
|
|
166
164
|
if (!key.includes(`"method":"${targetMethod}"`)) continue;
|
|
167
165
|
const actualPath = extractPathFromKey(key);
|
|
168
166
|
if (!actualPath) continue;
|
package/dist/index.mjs
CHANGED
|
@@ -121,7 +121,6 @@ function getMatchingEntries(stateManager, targetPath, targetMethod) {
|
|
|
121
121
|
if (hasPatternParams(targetPath)) {
|
|
122
122
|
const allEntries = stateManager.getAllCacheEntries();
|
|
123
123
|
for (const { key, entry } of allEntries) {
|
|
124
|
-
if (key.includes('"type":"infinite-tracker"')) continue;
|
|
125
124
|
if (!key.includes(`"method":"${targetMethod}"`)) continue;
|
|
126
125
|
const actualPath = extractPathFromKey(key);
|
|
127
126
|
if (!actualPath) continue;
|
|
@@ -136,7 +135,6 @@ function getMatchingEntries(stateManager, targetPath, targetMethod) {
|
|
|
136
135
|
} else {
|
|
137
136
|
const allEntries = stateManager.getAllCacheEntries();
|
|
138
137
|
for (const { key, entry } of allEntries) {
|
|
139
|
-
if (key.includes('"type":"infinite-tracker"')) continue;
|
|
140
138
|
if (!key.includes(`"method":"${targetMethod}"`)) continue;
|
|
141
139
|
const actualPath = extractPathFromKey(key);
|
|
142
140
|
if (!actualPath) continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-optimistic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Optimistic updates plugin for Spoosh - instant UI updates with automatic rollback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.
|
|
36
|
+
"@spoosh/core": ">=0.15.0",
|
|
37
37
|
"@spoosh/plugin-invalidation": ">=0.7.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@spoosh/core": "0.
|
|
41
|
-
"@spoosh/plugin-invalidation": "0.
|
|
42
|
-
"@spoosh/test-utils": "0.
|
|
40
|
+
"@spoosh/core": "0.15.0",
|
|
41
|
+
"@spoosh/plugin-invalidation": "0.9.0",
|
|
42
|
+
"@spoosh/test-utils": "0.3.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "tsup --watch",
|