Created
          December 5, 2017 02:04 
        
      - 
      
 - 
        
Save rafaellucio/4746d64707ae56444fbf12efda00171e 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 React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| const initialState = { | |
| count: 0 | |
| } | |
| function reducer(state = initialState, action) { | |
| switch (action.type) { | |
| case 'INCREMENT': | |
| return { | |
| count: state.count + 1 | |
| } | |
| case 'DECREMENT': | |
| return { | |
| count: state.count - 1 | |
| } | |
| default: | |
| return state | |
| } | |
| } | |
| const store = createStore(reducer) | |
| const App = () => ( | |
| <Provider store={store}> | |
| <CounterContainer /> | |
| </Provider> | |
| ) | |
| export default App | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment