useHandleConnection appears not to be working #1413
-
Hello! First of all thanks for the repo, it's awesome!
However the ouput when I trigger the function is: The image shows that even though the handlers and the nodes have connections and edges, the value of the array recieved from useHandleConnection({params}) is empty. I assume that if they have an edge, they also have the connection that the edge represents. Maybe I'm thinking wrong, however, I find it weird that I can correctly get the handler id's and not the connections that they have. thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
const { getConnectedEdges } = useVueFlow()
function handleSomething() {
for (const node of nodes) {
const connectedEdges = getConnectedEdges(node.id)
// now you can filter your edges by direction if you need to
}
}
|
Beta Was this translation helpful? Give feedback.
Composables are supposed to be called in the setup body of a component (same as React Hooks).
Instead of what you're doing just use
getConnectedEdges
to receive all edges that are connected to a node.Afterwards you can still filter edges by direction if you need to.