git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 797539afe1ecc1750ba1b41a253a250e56b5b7ca

Files: 797539afe1ecc1750ba1b41a253a250e56b5b7ca / app / client.js

727 bytesRaw
1const React = require('react')
2const { render } = require('react-dom')
3const { createStore, applyMiddleware } = require('redux')
4const { Provider } = require('react-redux')
5const logger = require('redux-logger')
6const thunk = require('redux-thunk')
7
8const reducer = require('./reducers')
9const { getAllTodos } = require('./actions')
10const App = require('./containers/App')
11
12const middleware = process.env.NODE_ENV === 'production' ?
13 [ thunk ] :
14 [ thunk, logger() ]
15
16const createStoreWithMiddleware = applyMiddleware(...middleware)(createStore)
17const store = createStoreWithMiddleware(reducer)
18
19store.dispatch(getAllTodos())
20
21render(
22 <Provider store={store}>
23 <App />
24 </Provider>,
25 document.getElementById('root')
26)
27

Built with git-ssb-web