Observes the url for any changes and calls a callback if it changes.
Instead of using the UrlObserver directly you may extend it:
example
class MyThing extends UrlObserver {
constructor() {
// don't provide a callback because we're using it directly.super(1000);
}
// this method is called whenever the url changes
onUrlChange(old: string, updated: string): void {
console.info(`the url has changed from ${old} to ${updated}`);
}
}
Observes the url for any changes and calls a callback if it changes.
Instead of using the UrlObserver directly you may extend it:
class MyThing extends UrlObserver { constructor() { // don't provide a callback because we're using it directly. super(1000); } // this method is called whenever the url changes onUrlChange(old: string, updated: string): void { console.info(`the url has changed from ${old} to ${updated}`); } }