@reforgium/presentia 1.4.2 → 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.
|
@@ -1414,8 +1414,9 @@ class RouteWatcher {
|
|
|
1414
1414
|
constructor() {
|
|
1415
1415
|
const read = () => {
|
|
1416
1416
|
const snap = this.deepestSnapshot();
|
|
1417
|
-
const url =
|
|
1418
|
-
|
|
1417
|
+
const url = snapshotFullPath(snap);
|
|
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);
|
|
@@ -1449,6 +1450,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1449
1450
|
function joinUrl(segments) {
|
|
1450
1451
|
return segments.length ? segments.map((s) => s.path).join('/') : '';
|
|
1451
1452
|
}
|
|
1453
|
+
/** Builds a full route path from root to current snapshot */
|
|
1454
|
+
function snapshotFullPath(snap) {
|
|
1455
|
+
return snap.pathFromRoot
|
|
1456
|
+
.map((s) => joinUrl(s.url))
|
|
1457
|
+
.filter(Boolean)
|
|
1458
|
+
.join('/');
|
|
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
|
+
}
|
|
1452
1464
|
|
|
1453
1465
|
/**
|
|
1454
1466
|
* Generated bundle index. Do not edit.
|
package/package.json
CHANGED