useHandleConnections
このフックは、ハンドルの接続が変更されたときに通知を受け取るために使用できます。
<script lang="ts">
import { useHandleConnections } from '@xyflow/svelte';
const connections = useHandleConnections({ nodeId: 'node-id', type: 'target' });
$: {
// This will be called whenever connections change
// for the target handle in the node with id 'node-id'
console.log($connections);
}
</script>
シグネチャ
名前 | 型 |
---|---|
#パラメータ |
|
# nodeId | string |
# type | "source" | "target" ハンドルのタイプ |
string ハンドルのID。これは、同じタイプのハンドルが複数ある場合にのみ必要です。 | |
#戻り値 |
|
読み取り可能<Connection[]> このハンドルに接続されている接続の読み取り可能なストア。 |
注釈
- このフックの使い方は、フロー計算の例をご覧ください。