useEdge(id: string)
This hook returns the edge with the specified ID. When you subscribe, it will trigger whenever
the edge changes. This happens when the edge is updated. The return value exposes a .current property to access the edge.
<script lang="ts">
import { useEdge } from '@xyflow/svelte';
const edge = useEdge('edge-id');
$inspect(edge.current);
</script>Signature
Parameters:| Name | Type | Default |
|---|---|---|
id | stringThe id of the edge to get |
The current edge inside a Svelte Flow context
| Name | Type |
|---|---|
current | EdgeType | undefined |