-
-
Save zbyte64/bb5c9075dbba0371f649 to your computer and use it in GitHub Desktop.
This file contains 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
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