daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top