Skip to Content
πŸ“£ We just released Svelte Flow 1.0 Alpha β€” try it out and give us your feedback!

isEdge()

Source on GitHub 

Test whether an object is useable as an Edge. In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true.

import { isEdge } from '@xyflow/svelte'; const edge = { id: 'edge-a', source: 'a', target: 'b', }; if (isEdge(edge)) { // .. }

Signature

#Params
#item
any
#Returns
boolean
Tests if whatever you passed in can be used as an edge. If you're using TypeScript, this function actions as a type guard and will narrow the type of whatever you pass in to an Edge if it returns true.
Last updated on