Skip to content

Instantly share code, notes, and snippets.

@iAmShakil
Created August 31, 2018 17:15
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 iAmShakil/86153e89cd6cb87b8c973981bb2d550e to your computer and use it in GitHub Desktop.
Save iAmShakil/86153e89cd6cb87b8c973981bb2d550e to your computer and use it in GitHub Desktop.
const reducer = ( state = 0, action ) => {
switch(action.type){
case "INCREMENT":
return state + 1
case "DECREMENT":
return state - 1
default:
return state
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment