docs: some module intro comments

pull/13520/head
Simon Holthausen 3 months ago
parent 51939e2743
commit dfb8eee1cc

@ -2,4 +2,6 @@
title: svelte/legacy title: svelte/legacy
--- ---
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.
> MODULE: svelte/legacy > MODULE: svelte/legacy

@ -2,4 +2,24 @@
title: svelte/reactivity title: svelte/reactivity
--- ---
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.
```svelte
<script>
import { SvelteURL } from 'svelte/reactivity';
const url = new SvelteURL('https://example.com/path');
</script>
<!-- changes to these... -->
<input bind:value={url.protocol} />
<input bind:value={url.hostname} />
<input bind:value={url.pathname} />
<hr />
<!-- will update `href` and vice versa -->
<input bind:value={url.href} />
```
> MODULE: svelte/reactivity > MODULE: svelte/reactivity

Loading…
Cancel
Save