The reload()
method of the Navigation
interface reloads the current URL, updating any provided state in the history entries list.
An object with the following properties:
committed
-
A Promise
which will fulfill when the visible URL has changed and a new NavigationHistoryEntry
has been created.
finished
-
A Promise
which will fulfill when all promises returned by the intercept()
handler are fulfilled. This is equivalent to the NavigationTransition.finished
promise fulfilling, when the navigatesuccess
event fires.
Either one of these promises rejects if the navigation has failed for some reason.
async function handleReload() {
await navigation.reload({
info: { animation: "fade-in" },
state: { infoPaneOpen: true },
});
}
Reload page and add a new state item:
async function handleReload() {
await navigation.reload({
state: { ...navigation.currentEntry.getState(), newState: 3 },
});
}