Skip to content

Instantly share code, notes, and snippets.

@abalone0204
Created November 28, 2015 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abalone0204/734bd152950161e84af9 to your computer and use it in GitHub Desktop.
Save abalone0204/734bd152950161e84af9 to your computer and use it in GitHub Desktop.
Counter reducder
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