refactor(core): allow setting handleId in useNodeConnections (#1732)

* refactor(core): allow setting handleId in useNodeConnections

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): deprecate useHandleConnections

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(examples): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(docs): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(docs): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2025-01-12 10:05:01 +01:00
parent 268ed0e84e
commit 3d1b85fce2
12 changed files with 122 additions and 114 deletions
+5 -2
View File
@@ -102,8 +102,7 @@ const connections = useHandleConnections({
## [useNodeConnections](/typedocs/functions/useNodeConnections)
`useNodeConnections` provides you with an array of connections that are connected to a specific node.
This composable is especially useful when you want to get all connections (of either type `source` or `target`) of a node
instead of just the connections of a specific `<Handle>`.
This composable is especially useful when you want to get all connections (of either type `source` or `target`) of a node.
```ts
import { type HandleConnection, useNodeConnections } from '@vue-flow/core'
@@ -119,6 +118,10 @@ const sourceConnections = useNodeConnections({
type: 'source',
})
const handleConnections = useNodeConnections({
handleId: 'handle-1', // you can explicitly pass a handle id if you want to get connections of a specific handle
})
const connections = useNodeConnections({
nodeId: '1', // you can explicitly pass a node id, otherwise it's used from the `NodeId injection
type: 'target',