Skip to content

Instantly share code, notes, and snippets.

@zbyte64
Forked from anonymous/sample.jsx
Last active August 29, 2015 14:20
Show Gist options
  • Save zbyte64/bb5c9075dbba0371f649 to your computer and use it in GitHub Desktop.
Save zbyte64/bb5c9075dbba0371f649 to your computer and use it in GitHub Desktop.
function siteDef(state) {
return <div>
function* () {
var state = "Your Site";
var resolve;
function render() {
return <h1 contentEditable={true} onInput={onInput}>{state}</h1>;
}
function rerender() {
resolve(render())
}
function onInput(event) {
state = event.target.innerHTML;
rerender()
}
yield render()
while (true) {
yield new Promise(function(_resolve, reject) {
resolve = _resolve;
});
}
}
<div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment