@zero-dependency/domFunctionslocationObserverlocationObserver CallablelocationObserver<T>(events: Events<T>): voidObserves 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.@examplelocationObserver<{ id: string }>({ onPush: (location, args) => {}, onReplace: (location, args) => {}})Type parametersTParametersevents: Events<T>An object that contains optional callback functions for push and replace actions.Returns 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.