Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Created Feb 26, 2017
Embed
What would you like to do?
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