port more examples
This commit is contained in:
+12
-4
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user