react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

Question: What event is fired when a link is formed.

Open jtwigg opened this issue 2 years ago • 1 comments

Question: What event fires when a new link is formed and how to I register a listener for it?

I've read this issue start to finish but I cannot still cannot see a reasonable way to get an event to fire when a link is connected from port1 -> port2

https://github.com/projectstorm/react-diagrams/issues/750

This seems to be asking the same question too: https://github.com/projectstorm/react-diagrams/issues/845

jtwigg avatar Apr 23 '22 15:04 jtwigg

If you are looking for event listener when a connection is made, here you go

model.registerListener({
        linksUpdated: (event) => {
           event.link.registerListener({
               targetPortChanged: (event) => {
                   console.log('Link Changed');
               }
           })
        }
    });

amith2368 avatar May 21 '22 18:05 amith2368