@instantdb/core 0.22.86-experimental.split-store.20247691802.1 → 0.22.86-experimental.split-store.20249702529.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/__tests__/src/store.test.ts +11 -4
- package/dist/commonjs/Reactor.js +2 -2
- package/dist/commonjs/Reactor.js.map +1 -1
- package/dist/commonjs/store.d.ts.map +1 -1
- package/dist/commonjs/store.js +1 -0
- package/dist/commonjs/store.js.map +1 -1
- package/dist/esm/Reactor.js +2 -2
- package/dist/esm/Reactor.js.map +1 -1
- package/dist/esm/store.d.ts.map +1 -1
- package/dist/esm/store.js +1 -0
- package/dist/esm/store.js.map +1 -1
- package/dist/standalone/index.js +68 -68
- package/dist/standalone/index.umd.cjs +2 -2
- package/package.json +2 -2
- package/src/Reactor.js +2 -2
- package/src/store.ts +1 -0
|
@@ -64,8 +64,13 @@ function checkIndexIntegrity({
|
|
|
64
64
|
const aevTriples = allMapValues(store.aev, 3).sort(tripleSort);
|
|
65
65
|
const vaeTriples = allMapValues(store.vae, 3);
|
|
66
66
|
|
|
67
|
-
// Check eav and aev have all the same
|
|
68
|
-
|
|
67
|
+
// Check eav and aev have all the same triples
|
|
68
|
+
for (let i = 0; i < eavTriples.length; i++) {
|
|
69
|
+
const et = eavTriples[i];
|
|
70
|
+
const at = aevTriples[i];
|
|
71
|
+
expect(et).toEqual(at);
|
|
72
|
+
}
|
|
73
|
+
expect(eavTriples.length).toEqual(aevTriples.length);
|
|
69
74
|
|
|
70
75
|
// Check vae doesn't have extra triples
|
|
71
76
|
for (const triple of vaeTriples) {
|
|
@@ -512,6 +517,8 @@ test('deepMerge', () => {
|
|
|
512
517
|
),
|
|
513
518
|
);
|
|
514
519
|
|
|
520
|
+
checkIndexIntegrity(gameCtx);
|
|
521
|
+
|
|
515
522
|
const updatedCtx = transact(
|
|
516
523
|
gameCtx.store,
|
|
517
524
|
gameCtx.attrsStore,
|
|
@@ -537,6 +544,7 @@ test('deepMerge', () => {
|
|
|
537
544
|
}),
|
|
538
545
|
),
|
|
539
546
|
);
|
|
547
|
+
|
|
540
548
|
const updatedGame = query(updatedCtx, {
|
|
541
549
|
games: { $: { where: { id: gameId } } },
|
|
542
550
|
}).data.games[0];
|
|
@@ -551,8 +559,7 @@ test('deepMerge', () => {
|
|
|
551
559
|
inventory: ['shield'],
|
|
552
560
|
locations: ['forest', undefined, 'castle'],
|
|
553
561
|
});
|
|
554
|
-
|
|
555
|
-
//checkIndexIntegrity(updatedCtx);
|
|
562
|
+
checkIndexIntegrity(updatedCtx);
|
|
556
563
|
});
|
|
557
564
|
|
|
558
565
|
test('recursive links w same id', () => {
|
package/dist/commonjs/Reactor.js
CHANGED
|
@@ -792,7 +792,7 @@ class Reactor {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
if (newAttrs.length) {
|
|
795
|
-
const existingAttrs = Object.values(this.ensureAttrs());
|
|
795
|
+
const existingAttrs = Object.values(this.ensureAttrs().attrs);
|
|
796
796
|
this._setAttrs([...existingAttrs, ...newAttrs]);
|
|
797
797
|
this._setAttrs(newAttrs);
|
|
798
798
|
}
|
|
@@ -1600,7 +1600,7 @@ class Reactor {
|
|
|
1600
1600
|
if (!this.attrs)
|
|
1601
1601
|
return;
|
|
1602
1602
|
const oas = this.optimisticAttrs();
|
|
1603
|
-
this.attrsCbs.forEach((cb) => cb(oas));
|
|
1603
|
+
this.attrsCbs.forEach((cb) => cb(oas.attrs));
|
|
1604
1604
|
}
|
|
1605
1605
|
notifyConnectionStatusSubs(status) {
|
|
1606
1606
|
this.connectionStatusCbs.forEach((cb) => cb(status));
|