|
|
@ -99,14 +99,14 @@ Svelte provides reactive wrappers for the native `Map`, `Set` and `Date` objects
|
|
|
|
|
|
|
|
|
|
|
|
```svelte
|
|
|
|
```svelte
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { Map } from 'svelte/reactivity';
|
|
|
|
import { Map } from 'svelte/reactivity';
|
|
|
|
|
|
|
|
|
|
|
|
const map = new Map();
|
|
|
|
const map = new Map();
|
|
|
|
map.set('message', 'hello');
|
|
|
|
map.set('message', 'hello');
|
|
|
|
|
|
|
|
|
|
|
|
function update_message() {
|
|
|
|
function update_message() {
|
|
|
|
map.set('message', 'goodbye');
|
|
|
|
map.set('message', 'goodbye');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<p>{map.get('message')}</p>
|
|
|
|
<p>{map.get('message')}</p>
|
|
|
|