mipd
mipd copied to clipboard
Update Svelte example
Svelte stores are just objects with a subscribe() method. This means you can use MIPD Store directly!
<script lang="ts">
import { createStore } from 'mipd'
const providers = createStore()
</script>
{#each $providers as provider}
<!-- ... -->
{/each}
providers is filled in dynamically with events, this needs to be reactive.
@glitch-txs If I understand correctly how providers.subscribe() works, then $providers is reactive in Svelte.
(It’s a syntax sugar: when you prefix store name with a $, component will call subscribe() on it and will be updating the value every time it gets it from the store.)
@glitch-txs Please do let me know if you have more questions!