chore(svelte/hooks): add docs
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user