Created
July 27, 2017 15:31
-
-
Save WebReflection/cb31fccf6668e69896fb7b3eb6c1b916 to your computer and use it in GitHub Desktop.
One possible way to simplify hyperHTML components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const borrowedState = require('flatstate').setState; | |
class HyperElement extends HTMLElement { | |
constructor(...args) { | |
super(...args); | |
this.html = hyperHTML.bind(this); | |
} | |
render() {} | |
setState(state) { | |
borrowedState.call(this, state); | |
this.render(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment