Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Last active August 29, 2015 14:25
Show Gist options
  • Save yelouafi/8d22c462de2e547cc940 to your computer and use it in GitHub Desktop.
Save yelouafi/8d22c462de2e547cc940 to your computer and use it in GitHub Desktop.
function view(model, handler) {
return h('div', [
h('button', {
on : { click: handler.bind(null, {type: ADD}) }
}, 'Add'),
h('button', {
on : { click: handler.bind(null, {type: RESET}) }
}, 'Reset'),
h('hr'),
h('div.counter-list', model.counters.map(item => counterItemView(item, handler)))
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment