Last active
July 2, 2018 12:05
-
-
Save lupomontero/111600f518d34121da8b65853ae300a5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 state = { count: 0 }; | |
const reducer = (action) => { | |
switch (action.type) { | |
case 'INCREMENT': | |
state.count++; | |
break; | |
case 'DECREMENT': | |
state.count--; | |
break; | |
} | |
return state; | |
}; | |
module.exports = reducer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment