Skip to content

Commit

Permalink
testTab: refactor to class
Browse files Browse the repository at this point in the history
  • Loading branch information
serapath committed Jun 7, 2018
1 parent 9f5e8f4 commit 78fed31
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/app/tabs/test-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ var async = require('async')
var css = require('./styles/test-tab-styles')
var remixTests = require('remix-tests')

function append (container, txt) {
let child = yo`<div>${txt}</div>`
container.appendChild(child)
}

const prototype = {
constructor: function testTab (api = {}, events = {}, opts = {}) {
module.exports = class TestTab {
constructor (api = {}, events = {}, opts = {}) {
const self = this
self._opts = opts
self._api = api
Expand All @@ -27,12 +22,17 @@ const prototype = {
})

return { render () { return self._view.el } }
},
render: function render () {
}
render () {
const self = this
const api = self._api
var container = yo`<div class="tests" id="tests"></div>`

function append (container, txt) {
let child = yo`<div>${txt}</div>`
container.appendChild(child)
}

let testCallback = function (result) {
if (result.type === 'contract') {
append(container, '\n ' + result.value)
Expand Down Expand Up @@ -109,5 +109,3 @@ const prototype = {
return el
}
}
prototype.constructor.prototype = prototype
module.exports = prototype.constructor

0 comments on commit 78fed31

Please sign in to comment.