Reference
useNodesData()

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

#Params
#nodeId
string | string[]
#Returns
Readable<object | object[]>
A readable store with data object/s of passed node id/s.

Notes