Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Created February 26, 2017 13:58
Show Gist options
  • Save joaomilho/16a295f644f1a451489fc00eb04eab27 to your computer and use it in GitHub Desktop.
Save joaomilho/16a295f644f1a451489fc00eb04eab27 to your computer and use it in GitHub Desktop.
Act's <1.0 counter
const view = (count) =>
['p', [
['h1', count],
['button', {click: {add: 1}}, '+'],
['button', {click: {add: -1}}, '-']
]]
const reducer = (state, {type, payload}) =>
type === 'add' ? state + payload : state
main(view, { model: 0, reducer })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment