I want this to be fully client side rendering.. So, I don't want to refresh the page just to redo the promise..
Here's the code that I made..
{#await myFetchMethod("/api/v1/me")}
<Loading />
{:then loggedIn}
{#if loggedIn}
<Link class="mb-0 h3" to="/profile">Profile</Link>
<Link class="mb-0 h3" to="/logout">Logout</Link>
{:else}
<Link class="mb-0 h3" to="/login">Login</Link>
<Link class="mb-0 h3" to="/register">Register</Link>
{/if}
{:catch error}
<p>Can't connect to the server!</p>
<button on:click={whatShouldIDoHere}>Refresh</button>
{/await}
I want the refresh button to just redo the myFetchMethod("/api/v1/me")
promise and get the result as intended.