chore(useNodeConnections): add default param
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user