Skip to content

Commit dfb8eee

Browse files
committed
docs: some module intro comments
1 parent 51939e2 commit dfb8eee

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

documentation/docs/98-reference/21-svelte-legacy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
title: svelte/legacy
33
---
44

5+
This module provides various functions for use during the migration, since some features can't be replaced one to one with new features. All imports are marked as deprecated and should be migrated away from over time.
6+
57
> MODULE: svelte/legacy

documentation/docs/98-reference/21-svelte-reactivity.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,24 @@
22
title: svelte/reactivity
33
---
44

5+
Svelte provides reactive versions of various built-ins like `SvelteMap`, `SvelteSet` and `SvelteURL`. These can be imported from `svelte/reactivity` and used just like their native counterparts.
6+
7+
```svelte
8+
<script>
9+
import { SvelteURL } from 'svelte/reactivity';
10+
11+
const url = new SvelteURL('https://example.com/path');
12+
</script>
13+
14+
<!-- changes to these... -->
15+
<input bind:value={url.protocol} />
16+
<input bind:value={url.hostname} />
17+
<input bind:value={url.pathname} />
18+
19+
<hr />
20+
21+
<!-- will update `href` and vice versa -->
22+
<input bind:value={url.href} />
23+
```
24+
525
> MODULE: svelte/reactivity

0 commit comments

Comments
 (0)