From b5594879b82089413e1fba24e9d4351e2c443909 Mon Sep 17 00:00:00 2001 From: serapath Date: Fri, 18 May 2018 00:13:01 -0400 Subject: [PATCH] refactor compileTab to class --- src/app/tabs/compile-tab.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 1c17675220..9b7c54ba75 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -13,8 +13,19 @@ var publishOnSwarm = require('../contract/publishOnSwarm') var styles = styleGuide.chooser() -var x = { - compileTab: function compileTab (appAPI = {}, appEvents = {}, opts = {}) { +class CompileTab { + constructor (api = {}, events = {}, opts = {}) { + const self = this + self._opts = opts + self._api = api + self._events = events + self.data = { + autoCompile: self._opts.config.get('autoCompile') || false, + compileTimeout: null, + contractsDetails: {} + } + var appAPI = self._api + var appEvents = self._events // Containers var warnCompilationSlow = yo`` var compileIcon = yo`` @@ -318,7 +329,7 @@ function detailsHelpSection () { } } -module.exports = x.compileTab +module.exports = CompileTab const css = csjs` .compileTabView {