From 367fe51e7e1c55e39299e2e667ca4f399a474019 Mon Sep 17 00:00:00 2001
From: Sam Nystrom <sam@samnystrom.dev>
Date: Sun, 10 Mar 2024 16:23:07 -0400
Subject: cleanup

---
 src/NodeEditor.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/NodeEditor.tsx')

diff --git a/src/NodeEditor.tsx b/src/NodeEditor.tsx
index 17e7c27..e4b584d 100644
--- a/src/NodeEditor.tsx
+++ b/src/NodeEditor.tsx
@@ -63,7 +63,7 @@ export const NodeEditor = () => {
 	const instantiateNode = useMemo(nodeFactory, []);
 	const svgRef = useRef(null);
 
-	const nodes = useSignal([
+	const initialNodes = useMemo(() => [
 		instantiateNode(100, 100, nodeRegistry['Linspace']),
 		instantiateNode(350, 200, nodeRegistry['Math']),
 		instantiateNode(350, 50, nodeRegistry['Intersperse']),
@@ -72,6 +72,8 @@ export const NodeEditor = () => {
 		instantiateNode(900, 250, nodeRegistry['Plot']),
 	]);
 
+	const nodes = useSignal(initialNodes);
+
 	const currentLink = useSignal<null | Omit<LinkData, 'to'>>(null);
 	const links = useSignal<LinkData[]>([]);
 	const allLinks = useComputed(() => (links.value as LinkProps[]).concat(currentLink.value as LinkProps ?? []));
@@ -261,4 +263,4 @@ export const NodeEditor = () => {
 		</main>
 		</>
 	);
-};
\ No newline at end of file
+};
-- 
cgit v1.2.3

