@pgxsinkit/client 0.6.0-rc.1 → 0.6.0-rc.2
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 +10 -6
- package/dist/index.js.map +3 -3
- package/dist/worker/live-diff.d.ts.map +1 -1
- package/package.json +5 -5
- package/skills/core/SKILL.md +1 -1
- package/skills/operating/SKILL.md +1 -1
- package/src/worker/live-diff.ts +8 -5
package/dist/index.js
CHANGED
|
@@ -7300,13 +7300,11 @@ function computeLiveDiff(state, nextRows) {
|
|
|
7300
7300
|
const order = [];
|
|
7301
7301
|
const added = [];
|
|
7302
7302
|
const changed = [];
|
|
7303
|
-
const nextKeys = new Set;
|
|
7304
7303
|
const nextMap = new Map;
|
|
7305
7304
|
for (const row of nextRows) {
|
|
7306
7305
|
const key = rowKey(row, state.pkColumns);
|
|
7307
|
-
if (
|
|
7306
|
+
if (nextMap.has(key))
|
|
7308
7307
|
continue;
|
|
7309
|
-
nextKeys.add(key);
|
|
7310
7308
|
nextMap.set(key, row);
|
|
7311
7309
|
order.push(key);
|
|
7312
7310
|
const prior = state.previous.get(key);
|
|
@@ -7318,7 +7316,7 @@ function computeLiveDiff(state, nextRows) {
|
|
|
7318
7316
|
}
|
|
7319
7317
|
const removed = [];
|
|
7320
7318
|
for (const key of state.previous.keys()) {
|
|
7321
|
-
if (!
|
|
7319
|
+
if (!nextMap.has(key))
|
|
7322
7320
|
removed.push(key);
|
|
7323
7321
|
}
|
|
7324
7322
|
state.previous = nextMap;
|
|
@@ -7349,7 +7347,13 @@ class LiveRowsMaterializer {
|
|
|
7349
7347
|
this.byKey.set(key, row);
|
|
7350
7348
|
for (const { key, row } of diff.changed)
|
|
7351
7349
|
this.byKey.set(key, row);
|
|
7352
|
-
|
|
7350
|
+
const rows = [];
|
|
7351
|
+
for (const key of diff.order) {
|
|
7352
|
+
const row = this.byKey.get(key);
|
|
7353
|
+
if (row !== undefined)
|
|
7354
|
+
rows.push(row);
|
|
7355
|
+
}
|
|
7356
|
+
this.rows = rows;
|
|
7353
7357
|
return this.rows;
|
|
7354
7358
|
}
|
|
7355
7359
|
current() {
|
|
@@ -12930,4 +12934,4 @@ export {
|
|
|
12930
12934
|
wrapLiveQueryForMaterialization
|
|
12931
12935
|
};
|
|
12932
12936
|
|
|
12933
|
-
//# debugId=
|
|
12937
|
+
//# debugId=0070DC25354F3B0A64756E2164756E21
|