Guest User

Untitled

a guest
Dec 7th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import React from 'react'
  2. import { Provider } from 'react-redux'
  3. import { createStore } from 'redux'
  4. import CounterContainer from './Counter.container'
  5.  
  6. const initialState = {
  7. count: 0
  8. }
  9.  
  10. function reducer(state = initialState, action) {
  11. switch (action.type) {
  12. case 'INCREMENT':
  13. return {
  14. count: state.count + 1
  15. }
  16. case 'DECREMENT':
  17. return {
  18. count: state.count - 1
  19. }
  20. default:
  21. return state
  22. }
  23. }
  24.  
  25. const store = createStore(reducer)
  26.  
  27. const App = () => (
  28. <Provider store={store}>
  29. <CounterContainer />
  30. </Provider>
  31. )
  32.  
  33. export default App
Add Comment
Please, Sign In to add comment