Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UrlObserver

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}`);
    }
}

Hierarchy

  • UrlObserver

Index

Constructors

constructor

Properties

_observing

_observing: boolean

Optional callback

interval

interval: number

Optional url

url: undefined | string

Methods

Private _observeUrl

  • _observeUrl(): void

onUrlChange

  • onUrlChange(old: string | undefined, updated: string): void
  • This method is called whenever a url change is observed.

    You can override this method when inheriting from UrlObserver.

    Parameters

    • old: string | undefined
    • updated: string

    Returns void

start

  • start(): void

Generated using TypeDoc