update: Flow instance provides update node internals func

* Rename onLoadParams to FlowInstance
* Pass update node internals to instance
This commit is contained in:
Braks
2021-10-22 12:39:55 +02:00
parent cd32f14a5a
commit babcbd0e1f
23 changed files with 149 additions and 46 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import Flow, {
Controls,
Background,
Elements,
OnLoadParams,
FlowInstance,
FlowElement,
removeElements,
Connection,
@@ -81,7 +81,7 @@ const edgeTypes: Record<string, any> = {
const elements = ref<Elements>(initialElements as Elements)
const onLoad = (flowInstance: OnLoadParams) => flowInstance.fitView()
const onLoad = (flowInstance: FlowInstance) => flowInstance.fitView()
const onNodeDragStop = (node: Node) => console.log('drag stop', node)
const onElementClick = (element: FlowElement) => console.log('click', element)
const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value))