@absolutejs/sync 2.1.0 → 2.2.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/engine/collection.d.ts +14 -1
- package/dist/engine/index.js +6 -1
- package/dist/engine/index.js.map +4 -4
- package/dist/index.js +6 -1
- package/dist/index.js.map +3 -3
- package/dist/testing.js +6 -1
- package/dist/testing.js.map +3 -3
- package/dist/writeBehindCache.js +90 -0
- package/dist/writeBehindCache.js.map +10 -0
- package/package.json +6 -1
package/dist/testing.js
CHANGED
|
@@ -1014,6 +1014,9 @@ var createSyncEngine = (options = {}) => {
|
|
|
1014
1014
|
return subscription.view.reset(await subscription.rehydrate());
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
+
if (subscription.affects && !subscription.affects(change)) {
|
|
1018
|
+
return EMPTY_DIFF;
|
|
1019
|
+
}
|
|
1017
1020
|
return subscription.view.reset(await subscription.rehydrate());
|
|
1018
1021
|
};
|
|
1019
1022
|
const subscriptionsForTable = function* (table) {
|
|
@@ -1806,6 +1809,7 @@ var createSyncEngine = (options = {}) => {
|
|
|
1806
1809
|
return readRule ? rows.filter((row) => readRule(ctx, row)) : rows;
|
|
1807
1810
|
};
|
|
1808
1811
|
const incremental = match !== undefined && tables.length === 1;
|
|
1812
|
+
const boundAffects = !incremental && definition.affects ? (change) => definition.affects(change, params, ctx) : undefined;
|
|
1809
1813
|
const boundMatch = incremental ? (row) => match(row, params, ctx) && (readRule ? readRule(ctx, row) : true) : () => true;
|
|
1810
1814
|
const view = createMaterializedView({
|
|
1811
1815
|
key,
|
|
@@ -1820,6 +1824,7 @@ var createSyncEngine = (options = {}) => {
|
|
|
1820
1824
|
view,
|
|
1821
1825
|
incremental,
|
|
1822
1826
|
rehydrate,
|
|
1827
|
+
...boundAffects ? { affects: boundAffects } : {},
|
|
1823
1828
|
key,
|
|
1824
1829
|
onDiff: typedOnDiff
|
|
1825
1830
|
};
|
|
@@ -2572,5 +2577,5 @@ export {
|
|
|
2572
2577
|
createTestEngine
|
|
2573
2578
|
};
|
|
2574
2579
|
|
|
2575
|
-
//# debugId=
|
|
2580
|
+
//# debugId=F796E6726FCBFF2B64756E2164756E21
|
|
2576
2581
|
//# sourceMappingURL=testing.js.map
|