port more updates

This commit is contained in:
peterkogo
2024-12-17 17:37:26 +01:00
parent 72d3e014b7
commit 39930e705d
14 changed files with 68 additions and 57 deletions
@@ -0,0 +1,46 @@
import { useStore } from '$lib/store';
/**
* Hook for getting the current nodes from the store.
*
* @public
* @returns reactive signal of the current edges
*/
export function useNodes() {
const { nodes } = $derived(useStore());
return {
get current() {
return nodes;
}
};
}
/**
* Hook for getting the current edges from the store.
*
* @public
* @returns reactive signal of the current edges
*/
export function useEdges() {
const { edges } = $derived(useStore());
return {
get current() {
return edges;
}
};
}
/**
* Hook for getting the current viewport from the store.
*
* @public
* @returns reactive signal of the current viewport
*/
export function useViewport() {
const { viewport } = $derived(useStore());
return {
get current() {
return viewport;
}
};
}