refactor(nodes): only re render changed nodes

This commit is contained in:
moklick
2019-07-31 17:24:23 +02:00
parent 6e71591cb8
commit 3403203adb
9 changed files with 3950 additions and 3871 deletions
+4 -1
View File
@@ -20,9 +20,12 @@ export const Provider = (props) => {
const existingNode = state.nodes.find(n => n.id === propNode.id);
if (existingNode) {
const data = !isEqual(existingNode.data, propNode.data) ?
{ ...existingNode.data, ...propNode.data } : existingNode.data;
return {
...existingNode,
data: { ...existingNode.data, ...propNode.data }
data
};
}