Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(command.type == "REMOVE"){
- state = state.deleteIn(["lists", command.nodeType, "nodes", command.id]);
- state = state.updateIn(["lists", command.nodeType, "ids"], list => list.filter(id => id != command.id));
- state = state.update("names", names => names.delete(command.id));
- state.get("lists").forEach((list, type) => {
- list.get("nodes").forEach((node, id) => {
- state = state.updateIn(["lists", type, "nodes", id, "connections", "data"],
- data => data.filter(elem => elem.get("id") != command.id));
- state = state.updateIn(["lists", type, "nodes", id, "connections", "order"],
- order => order.filter(elem => elem.split(".")[0] != command.id));
- return true;
- });
- return true;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement