useNodesData
Source on GitHub (opens in a new tab)
With this hook you can receive the data of the passed node ids.
<script lang="ts">
import { useNodesData } from '@xyflow/svelte';
const nodeData = useNodesData(['node-id-a', 'node-id-b']);
$: {
// nodeData changes whenever the data of the passed node ids get updated
console.log($nodeData);
}
</script>Signature
| Name | Type |
|---|---|
#Params | |
# nodeId | string | string[] |
#Returns | |
Readable<object | object[]>A readable store with data object/s of passed node id/s. |
Notes
- Check the Reactive Flow example to see how this hook can be used