Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafaellucio/4746d64707ae56444fbf12efda00171e to your computer and use it in GitHub Desktop.
Save rafaellucio/4746d64707ae56444fbf12efda00171e to your computer and use it in GitHub Desktop.
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