abstracted subscribe to state in composite
This commit is contained in:
@ -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}
|
||||
|
@ -130,7 +130,7 @@ ${composite.layout.rows ? `grid-template-rows: ${composite.layout.rows};` : ''}
|
||||
<svelte:component
|
||||
this={Component}
|
||||
id={composite.id}
|
||||
{...composite.store}
|
||||
store={getCompositeStore(composite.id)}
|
||||
services={serviceProps}
|
||||
/>
|
||||
{:else if composite.component}
|
||||
@ -147,7 +147,7 @@ ${composite.layout.rows ? `grid-template-rows: ${composite.layout.rows};` : ''}
|
||||
<svelte:component
|
||||
this={ChildComponent}
|
||||
id={child.id}
|
||||
{...child.store}
|
||||
store={getCompositeStore(child.id)}
|
||||
services={childServiceProps}
|
||||
/>
|
||||
{#if child.children && child.children.length}
|
||||
|
Reference in New Issue
Block a user