chore(svelte/hooks): add docs

This commit is contained in:
moklick
2023-12-19 13:07:07 +01:00
parent 2681ead50c
commit ac4ac77a85
10 changed files with 61 additions and 3 deletions
@@ -1,10 +1,22 @@
import { useStore } from '$lib/store';
/**
* Hook for getting the current nodes from the store.
*
* @public
* @returns store with an array of nodes
*/
export function useNodes() {
const { nodes } = useStore();
return nodes;
}
/**
* Hook for getting the current edges from the store.
*
* @public
* @returns store with an array of edges
*/
export function useEdges() {
const { edges } = useStore();
return edges;