Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Created July 27, 2017 15:31
Show Gist options
  • Save WebReflection/cb31fccf6668e69896fb7b3eb6c1b916 to your computer and use it in GitHub Desktop.
Save WebReflection/cb31fccf6668e69896fb7b3eb6c1b916 to your computer and use it in GitHub Desktop.
One possible way to simplify hyperHTML components.
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