@reforgium/presentia 1.4.3 → 1.4.4
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.
|
@@ -1415,7 +1415,8 @@ class RouteWatcher {
|
|
|
1415
1415
|
const read = () => {
|
|
1416
1416
|
const snap = this.deepestSnapshot();
|
|
1417
1417
|
const url = snapshotFullPath(snap);
|
|
1418
|
-
|
|
1418
|
+
const params = snapshotMergedParams(snap);
|
|
1419
|
+
!deepEqual(params, this.#params()) && this.#params.set(params);
|
|
1419
1420
|
!deepEqual(snap.queryParams, this.#query()) && this.#query.set(snap.queryParams);
|
|
1420
1421
|
!deepEqual(snap.data, this.#data()) && this.#data.set(snap.data);
|
|
1421
1422
|
this.#url() !== url && this.#url.set(url);
|
|
@@ -1456,6 +1457,10 @@ function snapshotFullPath(snap) {
|
|
|
1456
1457
|
.filter(Boolean)
|
|
1457
1458
|
.join('/');
|
|
1458
1459
|
}
|
|
1460
|
+
/** Merges params from root to the deepest snapshot (child keys override parent). */
|
|
1461
|
+
function snapshotMergedParams(snap) {
|
|
1462
|
+
return snap.pathFromRoot.reduce((acc, route) => ({ ...acc, ...route.params }), {});
|
|
1463
|
+
}
|
|
1459
1464
|
|
|
1460
1465
|
/**
|
|
1461
1466
|
* Generated bundle index. Do not edit.
|
package/package.json
CHANGED