From a4c198b56e22a6369fefb21c7e80fe3204cb845c Mon Sep 17 00:00:00 2001 From: Be Date: Fri, 28 Dec 2018 01:17:18 -0600 Subject: [PATCH] Components.js: remove dependency on Lodash Lodash's assign function is no longer needed with Object.assign in ES6 with Qt 5.12. The ComponentContainer.applyLayer function ended up not being used and only confused people, so it is being removed instead of rewriting it to not Lodash. --- res/controllers/midi-components-0.0.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 0118c67bb86..60cc9abc056 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -31,7 +31,7 @@ if (Array.isArray(options) && typeof options[0] === 'number') { this.midi = options; } else { - _.assign(this, options); + Object.assign(this, options); } if (typeof this.unshift === 'function') { @@ -444,9 +444,7 @@ Encoder.prototype = new Component(); var ComponentContainer = function (initialLayer) { - if (typeof initialLayer === 'object') { - this.applyLayer(initialLayer); - } + Object.assign(this, initialLayer); }; ComponentContainer.prototype = { forEachComponent: function (operation, recursive) { @@ -534,25 +532,6 @@ this.isShifted = false; }); }, - applyLayer: function (newLayer, reconnectComponents) { - if (reconnectComponents !== false) { - reconnectComponents = true; - } - if (reconnectComponents === true) { - this.forEachComponent(function (component) { - component.disconnect(); - }); - } - - _.merge(this, newLayer); - - if (reconnectComponents === true) { - this.forEachComponent(function (component) { - component.connect(); - component.trigger(); - }); - } - }, }; var Deck = function (deckNumbers) {