This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Best way for patching goto()? Unsaved data // onbeforeunload logic #1040
Open
Description
Hey Sapper Community ❤️
I do:
async function gotoURL(...args) {
if (isFormUnsaved === true){
if (window.confirm("Are we leaving already?") === false){
return false;
}
}
return await goto(...args);
}
And it works for on:click.
How can I "patch" goto, for real links <a href="/somewhere">Meow</a>