Skip to content

Function: useNodesData

useNodesData<NodeType>(nodeId): ComputedRef<NodeData<NodeType> | null>

Composable for receiving data of one or multiple nodes

Type parameters

NameType
NodeTypeextends Node<any, any, string, NodeType> = GraphNode<any, any, string>

Parameters

NameTypeDescription
nodeIdMaybeRefOrGetter<string>The id (or ids) of the node to get the data from

Returns

ComputedRef<NodeData<NodeType> | null>

An array of data objects

useNodesData<NodeType>(nodeIds): ComputedRef<NodeData<NodeType>[]>

Type parameters

NameType
NodeTypeextends Node<any, any, string, NodeType> = GraphNode<any, any, string>

Parameters

NameType
nodeIdsMaybeRefOrGetter<string[]>

Returns

ComputedRef<NodeData<NodeType>[]>

useNodesData<NodeType>(nodeIds, guard): ComputedRef<NodeData<NodeType>[]>

Type parameters

NameType
NodeTypeextends Node<any, any, string, NodeType> = GraphNode<any, any, string>

Parameters

NameType
nodeIdsMaybeRefOrGetter<string[]>
guard(node: Node<any, any, string>) => node is NodeType

Returns

ComputedRef<NodeData<NodeType>[]>

Released under the MIT License.