Created
May 6, 2021 15:38
-
-
Save dacioromero/43955cf1c879edeb622a882c365ccdce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="typescript"> | |
import { writable } from 'svelte/store' | |
const store = writable(localStorage.getItem('key') ?? '') | |
store.subscribe(value => localStorage.setItem('key', value)) | |
</script> | |
<input bind:value={$store} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment