chore(useNodeConnections): add default param

This commit is contained in:
moklick
2025-01-07 13:34:37 +01:00
parent e37712bbb9
commit b601d385f3
2 changed files with 2 additions and 2 deletions
@@ -38,7 +38,7 @@ export function useNodeConnections({
nodeId,
onConnect,
onDisconnect,
}: UseNodeConnectionsParams): NodeConnection[] {
}: UseNodeConnectionsParams = {}): NodeConnection[] {
const _nodeId = useNodeId();
const currentNodeId = nodeId ?? _nodeId;
@@ -33,7 +33,7 @@ const initialConnections: NodeConnection[] = [];
* @todo @param param.onDisconnect - gets called when a connection is removed
* @returns an array with connections
*/
export function useNodeConnections({ type, nodeId, handleId }: UseNodeConnectionsParams) {
export function useNodeConnections({ type, nodeId, handleId }: UseNodeConnectionsParams = {}) {
const { edges, connectionLookup } = useStore();
const _nodeId = getContext<string>('svelteflow__node_id');