markAsReady()
}
- let removeHistoryListener: () => void
+ let removeHistoryListener: () => void | undefined
// attach listener to history to trigger navigations
function setupListeners() {
removeHistoryListener = routerHistory.listen((to, _from, info) => {
installedApps.add(app)
app.unmount = function () {
installedApps.delete(app)
+ // the router is not attached to an app anymore
if (installedApps.size < 1) {
- removeHistoryListener()
+ // invalidate the current navigation
+ pendingLocation = START_LOCATION_NORMALIZED
+ removeHistoryListener && removeHistoryListener()
currentRoute.value = START_LOCATION_NORMALIZED
started = false
ready = false