Creates a new BrowserHistory instance and initializes event listeners.
Gets the current browser location.
Current window.location object
Initializes the history instance by setting up event listeners.
Navigates to a new location by pushing a new history entry. This creates a new entry in the browser's history stack.
Location to navigate to
Replaces the current history entry with a new location. This updates the URL without creating a new history entry.
New location to set
Subscribes to history changes.
Function to call when location changes
Unsubscribe function
Removes a listener from the history change notifications.
Listener function to remove
Browser history implementation using the HTML5 History API. Manages browser navigation state and provides a consistent interface for programmatic navigation and location change notifications.