Updating node structure

This commit is contained in:
2026-01-09 18:52:22 +01:00
parent e2bddec525
commit 6a7ea0cd8d
6 changed files with 191 additions and 189 deletions
+17
View File
@@ -0,0 +1,17 @@
import { useEffect } from "react";
import { MessageStore } from "./use-messages";
import { NodeCallbacks, NodeClient } from "@/lib/node";
export default function useNode(
nodeId: string,
messageStore: MessageStore,
callbacks: NodeCallbacks
) {
useEffect(() => {
const client = new NodeClient(nodeId, messageStore, callbacks);
client.connect();
return () => client.disconnect();
}, [nodeId]);
}