Created
June 7, 2017 01:30
-
-
Save goofmint/69682c54ac747fdbf3a448ba3a128799 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
var yourName = ''; // Piece of data | |
// Plain event handler | |
function handleNameInput(evt) { | |
yourName = evt.target.value; | |
} | |
// This function uses the 'hyperscript' notation to create the virtual DOM. | |
function renderMaquette() { | |
return h('div', [ | |
h('input', { | |
type: 'text', placeholder: 'What is your name?', | |
value: yourName, oninput: handleNameInput | |
}), | |
h('p.output', ['Hello ' + (yourName || 'you') + '!']) | |
]); | |
} | |
projector.append(domNode, renderMaquette); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment