Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created June 7, 2017 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/69682c54ac747fdbf3a448ba3a128799 to your computer and use it in GitHub Desktop.
Save goofmint/69682c54ac747fdbf3a448ba3a128799 to your computer and use it in GitHub Desktop.
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