Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Created July 24, 2015 12:43
Show Gist options
  • Save yelouafi/cc7839cea4cbce9b0d64 to your computer and use it in GitHub Desktop.
Save yelouafi/cc7839cea4cbce9b0d64 to your computer and use it in GitHub Desktop.
//view() inchanged
function handler(state, event) {
return { name: event.target.value };
}
function viewHandler(state, event) {
const newState = handler(state, event);
const newVnode = view(newState, viewHandler);
updateDOM(newVnode);
}
const vnode = view({name: ''}, viewHandler);
updateDOM(vnode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment