@spoosh/plugin-optimistic 0.7.0 → 0.7.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.
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.mjs +5 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _spoosh_core from '@spoosh/core';
|
|
2
|
+
import { ReadPaths, FindMatchingKey, HasParams, ExtractParamNames, Simplify, ExtractData } from '@spoosh/core';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Check if query exists in the method config.
|
|
@@ -214,7 +215,7 @@ declare module "@spoosh/core" {
|
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
declare function optimisticPlugin(): SpooshPlugin<{
|
|
218
|
+
declare function optimisticPlugin(): _spoosh_core.SpooshPlugin<{
|
|
218
219
|
readOptions: OptimisticReadOptions;
|
|
219
220
|
writeOptions: OptimisticWriteOptions;
|
|
220
221
|
writeTriggerOptions: OptimisticWriteTriggerOptions;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _spoosh_core from '@spoosh/core';
|
|
2
|
+
import { ReadPaths, FindMatchingKey, HasParams, ExtractParamNames, Simplify, ExtractData } from '@spoosh/core';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Check if query exists in the method config.
|
|
@@ -214,7 +215,7 @@ declare module "@spoosh/core" {
|
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
declare function optimisticPlugin(): SpooshPlugin<{
|
|
218
|
+
declare function optimisticPlugin(): _spoosh_core.SpooshPlugin<{
|
|
218
219
|
readOptions: OptimisticReadOptions;
|
|
219
220
|
writeOptions: OptimisticWriteOptions;
|
|
220
221
|
writeTriggerOptions: OptimisticWriteTriggerOptions;
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(src_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
|
|
27
27
|
// src/plugin.ts
|
|
28
|
+
var import_core = require("@spoosh/core");
|
|
28
29
|
var import_plugin_invalidation = require("@spoosh/plugin-invalidation");
|
|
29
30
|
function createBuilder(state) {
|
|
30
31
|
return {
|
|
@@ -277,7 +278,7 @@ function buildSnapshotDiff(snapshots, mode = "apply") {
|
|
|
277
278
|
}
|
|
278
279
|
var PLUGIN_NAME = "spoosh:optimistic";
|
|
279
280
|
function optimisticPlugin() {
|
|
280
|
-
return {
|
|
281
|
+
return (0, import_core.createSpooshPlugin)({
|
|
281
282
|
name: PLUGIN_NAME,
|
|
282
283
|
operations: ["write"],
|
|
283
284
|
dependencies: ["spoosh:invalidation"],
|
|
@@ -382,5 +383,5 @@ function optimisticPlugin() {
|
|
|
382
383
|
}
|
|
383
384
|
return response;
|
|
384
385
|
}
|
|
385
|
-
};
|
|
386
|
+
});
|
|
386
387
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// src/plugin.ts
|
|
2
|
+
import {
|
|
3
|
+
createSpooshPlugin
|
|
4
|
+
} from "@spoosh/core";
|
|
2
5
|
import "@spoosh/plugin-invalidation";
|
|
3
6
|
function createBuilder(state) {
|
|
4
7
|
return {
|
|
@@ -251,7 +254,7 @@ function buildSnapshotDiff(snapshots, mode = "apply") {
|
|
|
251
254
|
}
|
|
252
255
|
var PLUGIN_NAME = "spoosh:optimistic";
|
|
253
256
|
function optimisticPlugin() {
|
|
254
|
-
return {
|
|
257
|
+
return createSpooshPlugin({
|
|
255
258
|
name: PLUGIN_NAME,
|
|
256
259
|
operations: ["write"],
|
|
257
260
|
dependencies: ["spoosh:invalidation"],
|
|
@@ -356,7 +359,7 @@ function optimisticPlugin() {
|
|
|
356
359
|
}
|
|
357
360
|
return response;
|
|
358
361
|
}
|
|
359
|
-
};
|
|
362
|
+
});
|
|
360
363
|
}
|
|
361
364
|
export {
|
|
362
365
|
optimisticPlugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-optimistic",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Optimistic updates plugin for Spoosh - instant UI updates with automatic rollback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@spoosh/plugin-invalidation": ">=0.7.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@spoosh/core": "0.15.
|
|
41
|
-
"@spoosh/plugin-invalidation": "0.9.
|
|
40
|
+
"@spoosh/core": "0.15.1",
|
|
41
|
+
"@spoosh/plugin-invalidation": "0.9.1",
|
|
42
42
|
"@spoosh/test-utils": "0.3.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|