finished correct decoupling of action with svelte stores

This commit is contained in:
Samuel Andert
2023-07-22 18:11:20 +02:00
parent dc3995e327
commit 68708b65d8
5 changed files with 28 additions and 6 deletions

View File

@ -1,7 +1,13 @@
<script lang="ts">
import components from '$lib/components.ts';
import { getContextStore } from '$lib/stores/contextStore.ts';
export let componentsData = [];
// For each component, get or create its context store
componentsData.children.forEach((child) => {
child.store = getContextStore(child.componentName);
});
async function getComponent(componentName) {
if (components[componentName]) {
const module = await components[componentName]();