Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
testing out moving to lodash 4
  • Loading branch information
ManoMarks committed Aug 20, 2018
commit c06563c2a15e4609c04ff3f6adbfaf7688dd4f7c
8 changes: 4 additions & 4 deletions src/vis-logical/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function calculateLinks(services){

links.forEach((link,i) => {
const [uuid] = uuidRegExp.exec(link.from_service);
const source = _.findWhere(services,{ uuid });
const source = _.find(services,{ uuid });
if(!source) return;
serviceLinks.push({ source,target });
});
Expand Down Expand Up @@ -179,9 +179,9 @@ function restart(){

export default {
add(services){
console.log('CREATE', _.pluck(services,'name'));
console.log('CREATE', _.map(services,'name'));
var newServices = _.filter(
services,({uuid}) => !!!_.findWhere(NODES,{uuid})
services,({uuid}) => !!!_.find(NODES,{uuid})
);

NODES.push(...newServices);
Expand All @@ -191,7 +191,7 @@ export default {
update(service){
console.log('UPDATE', service.name);
let {uuid} = service;
let target = _.findWhere(NODES,{ uuid }) || {};
let target = _.find(NODES,{ uuid }) || {};
Object.assign(target,service);
LINKS = calculateLinks(NODES);
restart();
Expand Down