Skip to content

Conversation

notpushkin
Copy link

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}

@glitch-txs
Copy link
Contributor

providers is filled in dynamically with events, this needs to be reactive.

@notpushkin
Copy link
Author

@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.)

@notpushkin
Copy link
Author

@glitch-txs Please do let me know if you have more questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants