@signaldb/core 2.0.0-beta.15 → 2.0.0-beta.17
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/index34.cjs.js +15 -2
- package/dist/index34.mjs +15 -2
- package/package.json +1 -1
package/dist/index34.cjs.js
CHANGED
|
@@ -93,8 +93,21 @@ var WorkerDataAdapter = class WorkerDataAdapter {
|
|
|
93
93
|
let nextItems = items;
|
|
94
94
|
let deltaToPublish;
|
|
95
95
|
if (delta != null) {
|
|
96
|
-
|
|
97
|
-
if (require_queryDelta.isEmptyQueryDelta(delta))
|
|
96
|
+
const canApply = require_queryDelta.canApplyQueryDelta(query.items, delta);
|
|
97
|
+
if (!canApply || require_queryDelta.isEmptyQueryDelta(delta)) {
|
|
98
|
+
if (state === query.state) return;
|
|
99
|
+
this.updateQuery(collectionName, {
|
|
100
|
+
selector: query.selector,
|
|
101
|
+
options: query.options
|
|
102
|
+
}, {
|
|
103
|
+
state,
|
|
104
|
+
error
|
|
105
|
+
});
|
|
106
|
+
const settled = collectionQueries.get(id);
|
|
107
|
+
if (!settled) return;
|
|
108
|
+
settled.stateChangeCallbacks.forEach((callback) => require_queryDelta.callWithDelta(callback, state, canApply ? delta : void 0));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
98
111
|
const servedBefore = this.flattenPendingWrites(collectionName) == null ? null : this.servedResult(collectionName, query);
|
|
99
112
|
nextItems = require_queryDelta.applyQueryDelta(query.items, delta);
|
|
100
113
|
if (servedBefore == null) deltaToPublish = delta;
|
package/dist/index34.mjs
CHANGED
|
@@ -93,8 +93,21 @@ var WorkerDataAdapter = class WorkerDataAdapter {
|
|
|
93
93
|
let nextItems = items;
|
|
94
94
|
let deltaToPublish;
|
|
95
95
|
if (delta != null) {
|
|
96
|
-
|
|
97
|
-
if (isEmptyQueryDelta(delta))
|
|
96
|
+
const canApply = canApplyQueryDelta(query.items, delta);
|
|
97
|
+
if (!canApply || isEmptyQueryDelta(delta)) {
|
|
98
|
+
if (state === query.state) return;
|
|
99
|
+
this.updateQuery(collectionName, {
|
|
100
|
+
selector: query.selector,
|
|
101
|
+
options: query.options
|
|
102
|
+
}, {
|
|
103
|
+
state,
|
|
104
|
+
error
|
|
105
|
+
});
|
|
106
|
+
const settled = collectionQueries.get(id);
|
|
107
|
+
if (!settled) return;
|
|
108
|
+
settled.stateChangeCallbacks.forEach((callback) => callWithDelta(callback, state, canApply ? delta : void 0));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
98
111
|
const servedBefore = this.flattenPendingWrites(collectionName) == null ? null : this.servedResult(collectionName, query);
|
|
99
112
|
nextItems = applyQueryDelta(query.items, delta);
|
|
100
113
|
if (servedBefore == null) deltaToPublish = delta;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaldb/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.17",
|
|
4
4
|
"description": "SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON interface to places such as localStorage.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && vite build",
|