feat(store, flow)!: Add useNode/useEdge-state helpers
* for two way binding use the helpers
This commit is contained in:
@@ -106,6 +106,14 @@ export default (options?: FlowOptions): UseVueFlow => {
|
||||
const store = useStore(options)
|
||||
return {
|
||||
store,
|
||||
useNodesState: (nodes) => {
|
||||
store.setNodes(nodes)
|
||||
return store.nodes
|
||||
},
|
||||
useEdgesState: (edges) => {
|
||||
store.setEdges(edges)
|
||||
return store.edges
|
||||
},
|
||||
applyNodeChanges: (changes) => applyNodeChanges(changes, store.nodes),
|
||||
applyEdgeChanges: (changes) => applyEdgeChanges(changes, store.edges),
|
||||
...store.hooksOn,
|
||||
|
||||
Reference in New Issue
Block a user