Created
February 26, 2017 13:19
-
-
Save brookslyrette/38fb651bffa059a865303b02fda15631 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
| import { createStore } from 'redux' | |
| export const counter = (state = 0, action) => { | |
| switch (action.type) { | |
| case 'INCREMENT': | |
| return state + 1; | |
| case 'DECREMENT': | |
| return state - 1; | |
| case 'RESET': | |
| return 0; | |
| default: | |
| return state; | |
| } | |
| } | |
| let store = createStore(counter); | |
| export default store; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment