From 809a97d1942862a124cd35641b47e37c78e31f62 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Thu, 12 May 2016 17:40:11 +0200 Subject: [PATCH] Remove makeNode in reducer * was a relic from pre-immutable days * properties that were not there, were forgotten when adding nodes --- client/app/scripts/reducers/root.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/client/app/scripts/reducers/root.js b/client/app/scripts/reducers/root.js index de3669641..244f09921 100644 --- a/client/app/scripts/reducers/root.js +++ b/client/app/scripts/reducers/root.js @@ -14,21 +14,6 @@ const error = debug('scope:error'); // Helpers -function makeNode(node) { - return { - id: node.id, - label: node.label, - label_minor: node.label_minor, - node_count: node.node_count, - rank: node.rank, - pseudo: node.pseudo, - stack: node.stack, - shape: node.shape, - adjacency: node.adjacency, - metrics: node.metrics - }; -} - const topologySorter = topology => topology.get('rank'); // Initial values @@ -490,7 +475,7 @@ export function rootReducer(state = initialState, action) { // add new nodes _.each(action.delta.add, (node) => { - state = state.setIn(['nodes', node.id], fromJS(makeNode(node))); + state = state.setIn(['nodes', node.id], fromJS(node)); }); // apply pinned searches, filters nodes that dont match