-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document new connection callback API and useConnection
hook.
#472
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -365,9 +365,11 @@ export const edgeEventHandlerProps: PropsTableProps = { | |||
}, | |||
{ | |||
name: 'onReconnectEnd', | |||
type: '(event: React.MouseEvent, edge: Edge, handleType: "source" | "target") => void', | |||
type: '(event: React.MouseEvent, edge: Edge, handleType: "source" | "target", connectionState: Omit<ConnectionState, \'inProgress\'>) => void', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We created a new type LastConnectionType
for this. Could you use it here and for onConnectEnd
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find a reference to a LastConnectionType
in the codebase? Both onConnectEnd
and onReconnectEnd
use connectionState: FinalConnectionState
where FinalConnectionState
is a type alias for the type documented above.
See: https://github.com/xyflow/xyflow/blob/7b8fe28b37f79dd80ed0f915b834f2f61c57b73e/packages/system/src/types/general.ts#L53 and https://github.com/xyflow/xyflow/blob/7b8fe28b37f79dd80ed0f915b834f2f61c57b73e/packages/system/src/xyhandle/types.ts#L37
I can make a page for FinalConnectionState
but it felt a little superfluous to have a separate page for a type identical to ConnectionState
save for one field. Your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that make sense. If some one asks, we can still add it.
Good idea to document |
We tweaked the types of
useConnection
,onConnectEnd
, andonReconnectEnd
slightly. This PR updates the docs to reflect the new API. It also documents theInternalNode
type as that was being referenced without being documented.Closes #471.