make applyUrl and history public

so we don't need to bother with silent flags in replaceUrl
This commit is contained in:
Bruno Windels 2020-10-09 17:00:19 +02:00
parent 35b83b7976
commit d48bbd122a

View file

@ -25,12 +25,12 @@ export class URLRouter {
attach() { attach() {
this._subscription = this._history.subscribe(url => { 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 segments = this._segmentsFromUrl(url);
const path = this._navigation.pathFrom(segments); const path = this._navigation.pathFrom(segments);
this._navigation.applyPath(path); this._navigation.applyPath(path);
@ -59,9 +59,8 @@ export class URLRouter {
return segments; return segments;
} }
replaceUrl(url) { get history() {
// TODO: we don't want this to always to trigger an update return this._history;
this._history.replaceUrl(url);
} }
urlForSegment(type, value) { urlForSegment(type, value) {