Remove makeNode in reducer

* was a relic from pre-immutable days
* properties that were not there, were forgotten when adding nodes
This commit is contained in:
David Kaltschmidt
2016-05-12 17:40:11 +02:00
parent de6c3e711d
commit 809a97d194

View File

@@ -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