refactor(useNodeConnections): change param names
This commit is contained in:
@@ -12,7 +12,7 @@ function CustomHandle({ nodeId, ...handleProps }: HandleProps & { nodeId: string
|
||||
[nodeId]
|
||||
);
|
||||
const connections = useNodeConnections({
|
||||
type: handleProps.type,
|
||||
handleType: handleProps.type,
|
||||
handleId: handleProps.id,
|
||||
onConnect,
|
||||
onDisconnect,
|
||||
|
||||
@@ -15,7 +15,7 @@ function CustomHandle({ nodeId, ...handleProps }: HandleProps & { nodeId: string
|
||||
[nodeId]
|
||||
);
|
||||
const connections = useNodeConnections({
|
||||
type: handleProps.type,
|
||||
handleType: handleProps.type,
|
||||
handleId: handleProps.id,
|
||||
onConnect,
|
||||
onDisconnect,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isTextNode, type MyNode } from '.';
|
||||
|
||||
function ResultNode() {
|
||||
const connections = useNodeConnections({
|
||||
type: 'target',
|
||||
handleType: 'target',
|
||||
});
|
||||
const nodesData = useNodesData<MyNode>(connections.map((connection) => connection.source));
|
||||
const textNodes = nodesData.filter(isTextNode);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { isTextNode, type TextNode, type MyNode } from '.';
|
||||
function UppercaseNode({ id }: NodeProps) {
|
||||
const { updateNodeData } = useReactFlow();
|
||||
const connections = useNodeConnections({
|
||||
type: 'target',
|
||||
handleType: 'target',
|
||||
});
|
||||
const nodesData = useNodesData<MyNode>(connections[0]?.source);
|
||||
const textNode = isTextNode(nodesData) ? nodesData : null;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
$$restProps;
|
||||
|
||||
const connections = useNodeConnections({
|
||||
nodeId: id,
|
||||
type: 'target'
|
||||
id: id,
|
||||
handleType: 'target'
|
||||
});
|
||||
|
||||
$: nodeData = useNodesData<MyNode>($connections.map((connection) => connection.source));
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
const { updateNodeData } = useSvelteFlow();
|
||||
const connections = useNodeConnections({
|
||||
nodeId: id,
|
||||
type: 'target'
|
||||
id: id,
|
||||
handleType: 'target'
|
||||
});
|
||||
|
||||
$: nodeData = useNodesData<MyNode>($connections[0]?.source);
|
||||
|
||||
Reference in New Issue
Block a user