chore(useNodeConnections): add default param
This commit is contained in:
@@ -38,7 +38,7 @@ export function useNodeConnections({
|
|||||||
nodeId,
|
nodeId,
|
||||||
onConnect,
|
onConnect,
|
||||||
onDisconnect,
|
onDisconnect,
|
||||||
}: UseNodeConnectionsParams): NodeConnection[] {
|
}: UseNodeConnectionsParams = {}): NodeConnection[] {
|
||||||
const _nodeId = useNodeId();
|
const _nodeId = useNodeId();
|
||||||
const currentNodeId = nodeId ?? _nodeId;
|
const currentNodeId = nodeId ?? _nodeId;
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const initialConnections: NodeConnection[] = [];
|
|||||||
* @todo @param param.onDisconnect - gets called when a connection is removed
|
* @todo @param param.onDisconnect - gets called when a connection is removed
|
||||||
* @returns an array with connections
|
* @returns an array with connections
|
||||||
*/
|
*/
|
||||||
export function useNodeConnections({ type, nodeId, handleId }: UseNodeConnectionsParams) {
|
export function useNodeConnections({ type, nodeId, handleId }: UseNodeConnectionsParams = {}) {
|
||||||
const { edges, connectionLookup } = useStore();
|
const { edges, connectionLookup } = useStore();
|
||||||
|
|
||||||
const _nodeId = getContext<string>('svelteflow__node_id');
|
const _nodeId = getContext<string>('svelteflow__node_id');
|
||||||
|
|||||||
Reference in New Issue
Block a user