abstracted subscribe to state in composite

This commit is contained in:
Samuel Andert
2023-07-26 11:11:12 +02:00
parent e3f2dbacc8
commit 5c2f7afa5f
3 changed files with 21 additions and 16 deletions

View File

@ -1,12 +1,8 @@
<script>
export let id;
import { getCompositeStore } from '$lib/core/compositeStores';
import { onMount } from 'svelte';
const store = getCompositeStore(id);
export let services;
export let store;
onMount(async () => {
if (services && services.helloEarthAlert) {
@ -17,4 +13,6 @@
});
</script>
<div class="p-12 bg-blue-400">Hello Earth {JSON.stringify($store.pkpWallet.address)}</div>
{#if $store && $store.pkpWallet.address}
<div class="p-12 bg-blue-400">Hello Earth {JSON.stringify($store.pkpWallet.address)}</div>
{/if}