port more examples

This commit is contained in:
peterkogo
2024-12-17 16:52:14 +01:00
parent 2e03bbe063
commit 72d3e014b7
13 changed files with 61 additions and 72 deletions
@@ -7,8 +7,12 @@ import { useStore } from '$lib/store';
* @returns store with an array of nodes
*/
export function useNodes() {
const { nodes } = useStore();
return nodes;
const { nodes } = $derived(useStore());
return {
get current() {
return nodes;
}
};
}
/**
@@ -18,6 +22,10 @@ export function useNodes() {
* @returns store with an array of edges
*/
export function useEdges() {
const { edges } = useStore();
return edges;
const { edges } = $derived(useStore());
return {
get current() {
return edges;
}
};
}
+1 -1
View File
@@ -34,7 +34,7 @@ export * from '$lib/utils';
export * from '$lib/hooks/useSvelteFlow';
export * from '$lib/hooks/useUpdateNodeInternals';
export * from '$lib/hooks/useConnection.svelte';
export * from '$lib/hooks/useNodesEdges';
export * from '$lib/hooks/useNodesEdges.svelte';
export * from '$lib/hooks/useHandleConnections.svelte';
export * from '$lib/hooks/useNodesData';
export * from '$lib/hooks/useInternalNode';