chore(svelte): update examples

This commit is contained in:
moklick
2025-01-09 17:22:29 +01:00
parent aac614e719
commit a13b6bf4ea
2 changed files with 4 additions and 5 deletions
@@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import { import {
SvelteFlow, SvelteFlow,
useConnection, useNodeConnections,
useHandleConnections,
useSvelteFlow, useSvelteFlow,
type Edge, type Edge,
type Node, type Node,
@@ -30,7 +29,7 @@
const { screenToFlowPosition, flowToScreenPosition } = $derived(useSvelteFlow()); const { screenToFlowPosition, flowToScreenPosition } = $derived(useSvelteFlow());
const connections = useHandleConnections({ nodeId: '0', type: 'source' }); const connections = useNodeConnections({ id: '0', handleType: 'source' });
$inspect(connections.current); $inspect(connections.current);
@@ -4,7 +4,7 @@
Position, Position,
type NodeProps, type NodeProps,
type Connection, type Connection,
useHandleConnections useNodeConnections
} from '@xyflow/svelte'; } from '@xyflow/svelte';
let { id }: NodeProps = $props(); let { id }: NodeProps = $props();
@@ -25,7 +25,7 @@
console.log('disconnect source', handleId, connection); console.log('disconnect source', handleId, connection);
} }
const connections = useHandleConnections({ nodeId: id, type: 'target' }); const connections = useNodeConnections({ id: id, handleType: 'target' });
$inspect(connections.current); $inspect(connections.current);
</script> </script>