#onConnectEnd and onReconnectEnd

1 messages · Page 1 of 1 (latest)

acoustic iris
#

Maybe I'm doing something wrong, but are both onConnectEnd and onReconnectEnd event handlers supposed to fire when reconnecting an existing edge? I'd expect only onReconnectEnd to fire.

left marlin
#

No way it's David K! stately.ai is one of the interfaces I'm getting a lot of inspo from! I didn't realise it's using React Flow. Love using your state machines for collaborative software design!

Sorry I don't have any actual answer 😅 , but my guess would be that the logic is essentially: all reconnections are connections but not all connections are reconnections. So onConnect events are always expected, even when it's a reconnect type connection. 🤷‍♂️

acoustic iris
#

There's a lot of things from Stately that I haven't been able to migrate cleanly to React Flow yet... I may just manually handle those things myself for now

tribal brook
#

all reconnections are connections but not all connections are reconnections. So onConnect events are always expected, even when it's a reconnect type connection.
That is basically it, yeah.

ember temple
#

You can have a boolean ref, reconnectionStart which would turn to true in onReconnectStart and would turn to false in onReconnectEnd.

You can check for this boolean ref inside the onConnectEnd to see if this is a reconnection or a connection.

acoustic iris
#

Okay, I figured as much - a bit hacky but it'll work, thanks!

blazing halo
#

I agree that the API is a bit confusing here