Created
November 28, 2015 08:37
-
-
Save abalone0204/734bd152950161e84af9 to your computer and use it in GitHub Desktop.
Counter reducder
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 counter = (state =0 , action) => { | |
switch(action.type) { | |
case 'INC': | |
return state+1; | |
case 'DEC': | |
return state -1; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment