Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Last active August 29, 2015 14:25
Show Gist options
  • Save yelouafi/0547f21420249ea792dc to your computer and use it in GitHub Desktop.
Save yelouafi/0547f21420249ea792dc to your computer and use it in GitHub Desktop.
function view(model, handler) {
return h('div', [
h('button', {
on : { click: handler.bind(null, {type: RESET}) }
}, 'Reset'),
h('hr'),
counter.view(model.first, counterAction => handler({ type: UPDATE_FIRST, data: counterAction})),
h('hr'),
counter.view(model.second, counterAction => handler({ type: UPDATE_SECOND, data: counterAction})),
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment