Skip to content

Commit 5cb6ebc

Browse files
authored
Add solution as app-b
1 parent 75814a2 commit 5cb6ebc

File tree

1 file changed

+29
-0
lines changed
  • content/tutorial/03-sveltekit/08-stores/03-updated-store/app-b/src/routes

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<script>
2+
import { page, navigating, updated } from '$app/stores';
3+
</script>
4+
5+
<nav>
6+
<a href="/" aria-current={$page.url.pathname === '/'}>
7+
home
8+
</a>
9+
10+
<a href="/about" aria-current={$page.url.pathname === '/about'}>
11+
about
12+
</a>
13+
14+
{#if $navigating}
15+
navigating to {$navigating.to.url.pathname}
16+
{/if}
17+
</nav>
18+
19+
<slot />
20+
21+
{#if $updated}
22+
<p class="toast">
23+
A new version of the app is available
24+
25+
<button on:click={() => location.reload()}>
26+
reload the page
27+
</button>
28+
</p>
29+
{/if}

0 commit comments

Comments
 (0)