I have a component that loads some data asynchronously and displays it. There are also ways to navigate to different pages from that component. However, the navigation only happens after all #await
requests are resolved. I'd like to navigate immediately after the user clicks on the link and not wait for all the data of the old page to load. Is there a way to do that?
Rough outline of what I'm doing:
<script lang="ts"> import { goto } from '$app/navigation'; let slowRequest = getSlowData();</script><div class="flex flex-col"> {#await slowRequest} Loading... {:then result} result {/await}<button onclick={() => goto("/some/other/page")}> Navigate</button></div>
When I click the button I have to wait for the request to resolve before I'm redirected. Is there any way to directly go to the new page without waiting for a response?