Skip to main content

locationObserver

Callable

  • locationObserver<T>(events: Events<T>): void

  • Observes changes to the browser's location and history, and invokes the specified callbacks when the user navigates to a new page or updates the current page's state.

    @example
    locationObserver<{ id: string }>({
    onPush: (location, args) => {},
    onReplace: (location, args) => {}
    })

    Type parameters

    • T

    Parameters

    • events: Events<T>

      An object that contains optional callback functions for push and replace actions.

    Returns void