Created
April 2, 2016 20:48
-
-
Save ohAitch/2a34fd712a0212f75c4f33df52fad21c to your computer and use it in GitHub Desktop.
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
fooBarReducer = (fooBar=0,{addFooBar,clearFooBar})-> | |
switch | |
when addFooBar? then fooBar + addFooBar | |
when clearFooBar? then 0 | |
else fooBar | |
connect(({fooBar})-> count: fooBar) ({count, dispatch})-> | |
div {}, | |
button {onClick: -> dispatch addFooBar:5}, "Bump ", count | |
button {onClick: -> dispatch clearFooBar:yes}, "Reset" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment