From 3df69322c96ae93127f00f66113269409223afd9 Mon Sep 17 00:00:00 2001 From: John Shaver Date: Mon, 25 Mar 2019 20:24:57 -0700 Subject: [PATCH] add eslint --- hookComponentFactory.js | 4 +--- pureComponentFactory.js | 4 +--- test.js | 17 ----------------- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 test.js diff --git a/hookComponentFactory.js b/hookComponentFactory.js index 6b4a3e1..7a121cf 100644 --- a/hookComponentFactory.js +++ b/hookComponentFactory.js @@ -4,7 +4,7 @@ import getId from "./id.js"; export function hookComponentFactory(name, propNames, hookRender) { class ComponentClass extends HTMLElement { constructor (...args) { - super(); + super(...args); this.attachShadow({mode: 'open'}); this.identifier = getId(name); this.domRender = hookRender.bind(this); @@ -22,12 +22,10 @@ export function hookComponentFactory(name, propNames, hookRender) { this.render(this.parseAttributes()) } parseAttributes() { - console.log(this); let attr = {}; for(let i = 0; i < this.attributes.length; ++i) { attr[this.attributes[i].name] = this.getAttribute(this.attributes[i].name); } - console.log("Parse attributes: ", attr); return attr; } } diff --git a/pureComponentFactory.js b/pureComponentFactory.js index 1640344..c38d096 100644 --- a/pureComponentFactory.js +++ b/pureComponentFactory.js @@ -3,7 +3,7 @@ import getId from "./id.js"; export function pureComponentFactory (name, propNames, functionalRender) { class ComponentClass extends HTMLElement { constructor (...args) { - super(); + super(...args); this.attachShadow({mode: 'open'}); this.identifier = getId(name); return; @@ -23,12 +23,10 @@ export function pureComponentFactory (name, propNames, functionalRender) { this.render(this.parseAttributes()) } parseAttributes() { - console.log(this); let attr = {}; for(let i = 0; i < this.attributes.length; ++i) { attr[this.attributes[i].name] = this.getAttribute(this.attributes[i].name); } - console.log("Parse attributes: ", attr); return attr; } diff --git a/test.js b/test.js deleted file mode 100644 index 8166420..0000000 --- a/test.js +++ /dev/null @@ -1,17 +0,0 @@ - -let count = pureComponentFactory( - "count-ele", - ({count}) => { - console.log("RENDERING COUNT: ", count); - return `
` - } -); - -var buttonPress = function() { - let count = document.querySelector("#count"); - let oldValue = parseInt(count.getAttribute('count')) - let newValue = oldValue + 1; - console.log(`OldValue: ${oldValue} NewValue: ${newValue}`); - count.setAttribute('count', newValue.toString()); -}; -