Skip to content

Commit

Permalink
update nodes, edges, and network ref on update (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
uptycs-bhaskar authored Jun 14, 2021
1 parent 2c2a2f0 commit 551ed97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ const Graph = ({
edges.current.add(edgesAdded);
edges.current.update(edgesChanged);
}

if ((nodesChange || edgesChange) && getNetwork) {
getNetwork(network.current);
}

if (nodesChange && getNodes) {
getNodes(nodes.current);
}

if (edgesChange && getEdges) {
getEdges(edges.current);
}
}, [data]);

useEffect(() => {
Expand Down

0 comments on commit 551ed97

Please sign in to comment.