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;
}
};
}