chore(react/hooks): add docs

This commit is contained in:
moklick
2023-12-19 12:36:49 +01:00
parent 97ab615e6a
commit 2681ead50c
26 changed files with 175 additions and 65 deletions
+6
View File
@@ -5,6 +5,12 @@ import type { Node, ReactFlowState } from '../types';
const nodesSelector = (state: ReactFlowState) => state.nodes;
/**
* Hook for getting the current nodes from the store.
*
* @public
* @returns An array of nodes
*/
function useNodes<NodeType extends Node = Node>(): NodeType[] {
const nodes = useStore(nodesSelector, shallow) as NodeType[];