Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

535 B
Raw Blame
import { useStoreApi } from 'reactflow'

const useNodeInfo = (nodeId: string) => {
  const store = useStoreApi()
  const { getNodes } = store.getState()
  const allNodes = getNodes()
  const node = allNodes.find((n) => n.id === nodeId)
  const isInIteration = !!node?.data.isInIteration
  const isInLoop = !!node?.data.isInLoop
  const parentNodeId = node?.parentId
  const parentNode = allNodes.find((n) => n.id === parentNodeId)
  return {
    node,
    isInIteration,
    isInLoop,
    parentNode,
  }
}

export default useNodeInfo