@spoosh/plugin-optimistic 0.1.4 → 0.2.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.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function applyOptimisticUpdate(stateManager, config) {
|
|
|
101
101
|
data: config.updater(entry.state.data, void 0)
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
stateManager.
|
|
104
|
+
stateManager.setMeta(key, { isOptimistic: true });
|
|
105
105
|
}
|
|
106
106
|
return snapshots;
|
|
107
107
|
}
|
|
@@ -112,7 +112,7 @@ function confirmOptimistic(stateManager, snapshots) {
|
|
|
112
112
|
stateManager.setCache(key, {
|
|
113
113
|
previousData: void 0
|
|
114
114
|
});
|
|
115
|
-
stateManager.
|
|
115
|
+
stateManager.setMeta(key, { isOptimistic: false });
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -127,7 +127,7 @@ function rollbackOptimistic(stateManager, snapshots) {
|
|
|
127
127
|
data: previousData
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
stateManager.
|
|
130
|
+
stateManager.setMeta(key, { isOptimistic: false });
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -78,7 +78,7 @@ function applyOptimisticUpdate(stateManager, config) {
|
|
|
78
78
|
data: config.updater(entry.state.data, void 0)
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
stateManager.
|
|
81
|
+
stateManager.setMeta(key, { isOptimistic: true });
|
|
82
82
|
}
|
|
83
83
|
return snapshots;
|
|
84
84
|
}
|
|
@@ -89,7 +89,7 @@ function confirmOptimistic(stateManager, snapshots) {
|
|
|
89
89
|
stateManager.setCache(key, {
|
|
90
90
|
previousData: void 0
|
|
91
91
|
});
|
|
92
|
-
stateManager.
|
|
92
|
+
stateManager.setMeta(key, { isOptimistic: false });
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -104,7 +104,7 @@ function rollbackOptimistic(stateManager, snapshots) {
|
|
|
104
104
|
data: previousData
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
stateManager.
|
|
107
|
+
stateManager.setMeta(key, { isOptimistic: false });
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-optimistic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Optimistic updates plugin for Spoosh - instant UI updates with automatic rollback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@spoosh/core": ">=0.4.0",
|
|
37
|
-
"@spoosh/plugin-invalidation": ">=1.0
|
|
37
|
+
"@spoosh/plugin-invalidation": ">=0.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@spoosh/core": "0.
|
|
40
|
+
"@spoosh/core": "0.5.0",
|
|
41
41
|
"@spoosh/plugin-invalidation": "0.1.4",
|
|
42
42
|
"@spoosh/test-utils": "0.1.5"
|
|
43
43
|
},
|