refactor(svelte): cleanup store usage

This commit is contained in:
moklick
2023-02-28 12:43:29 +01:00
parent 7a879f3c54
commit 62a6278682
25 changed files with 420 additions and 397 deletions
@@ -4,7 +4,7 @@
import NodeWrapper from '$lib/components/nodes/NodeWrapper.svelte';
import { useStore } from '$lib/store';
const { nodesStore, updateNodeDimensions } = useStore();
const { nodes, updateNodeDimensions } = useStore();
const resizeObserver: ResizeObserver | null = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver((entries: ResizeObserverEntry[]) => {
const updates = entries.map((entry: ResizeObserverEntry) => ({
id: entry.target.getAttribute('data-id') as string,
@@ -21,7 +21,7 @@
</script>
<div class="react-flow__nodes">
{#each $nodesStore as node (node.id)}
{#each $nodes as node (node.id)}
<NodeWrapper {...node} {resizeObserver} />
{/each}
</div>