feat(core,composables): add useNodesData composable

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent c443af6991
commit cecf9d4c3b
3 changed files with 53 additions and 7 deletions
@@ -16,15 +16,16 @@ interface UseHandleConnectionsParams {
}
/**
* Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.
* Composable that returns existing connections of a handle
*
* @public
* @param param.type - handle type 'source' or 'target'
* @param param.nodeId - node id - if not provided, the node id from the NodeIdContext is used
* @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)
* @param param.onConnect - gets called when a connection is established
* @param param.onDisconnect - gets called when a connection is removed
* @returns an array with connections
* @param UseHandleConnectionsParams
* @param UseHandleConnectionsParams.type - handle type `source` or `target`
* @param UseHandleConnectionsParams.nodeId - node id - if not provided, the node id from the `useNodeId` (meaning, the context-based injection) is used
* @param UseHandleConnectionsParams.id - the handle id (this is required if the node has multiple handles of the same type)
* @param UseHandleConnectionsParams.onConnect - gets called when a connection is created
* @param UseHandleConnectionsParams.onDisconnect - gets called when a connection is removed
* @returns An array of connections
*/
export function useHandleConnections({
type,