Created
February 26, 2017 13:58
-
-
Save joaomilho/16a295f644f1a451489fc00eb04eab27 to your computer and use it in GitHub Desktop.
Act's <1.0 counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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