useStore

GitHubのソースコード

このフックは、Svelte Flowの内部ストアにアクセスするために使用できます。

このフックは、高度なユースケースでのみ必要です。内部状態にアクセスする他の方法がない場合にのみ使用してください。多くの一般的なユースケースでは、useConnectionuseNodesなど、専用のフックが用意されています。

<script lang="ts">
  import { useStore } from '@xyflow/svelte';
 
  // lots of props that you pass to the <SvelteFlow> component end up in the internal store.
  // Here we are accessing the current connectionMode.
  const { connectionMode } = useStore();
</script>

シグネチャ

#戻り値
#Svelte Flow Store プロパティ
SvelteFlowStore