From d48bbd122acc79547213ee21f16dce8ab49dea1e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 9 Oct 2020 17:00:19 +0200 Subject: [PATCH] make applyUrl and history public so we don't need to bother with silent flags in replaceUrl --- src/domain/navigation/URLRouter.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/domain/navigation/URLRouter.js b/src/domain/navigation/URLRouter.js index d0f66fe6..5757ca10 100644 --- a/src/domain/navigation/URLRouter.js +++ b/src/domain/navigation/URLRouter.js @@ -25,12 +25,12 @@ export class URLRouter { attach() { this._subscription = this._history.subscribe(url => { - this._applyUrl(url); + this.applyUrl(url); }); - this._applyUrl(this._history.get()); + this.applyUrl(this._history.get()); } - _applyUrl(url) { + applyUrl(url) { const segments = this._segmentsFromUrl(url); const path = this._navigation.pathFrom(segments); this._navigation.applyPath(path); @@ -59,9 +59,8 @@ export class URLRouter { return segments; } - replaceUrl(url) { - // TODO: we don't want this to always to trigger an update - this._history.replaceUrl(url); + get history() { + return this._history; } urlForSegment(type, value) {