git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: a51858b13e497beda1e5deb1c48381c361a0ccfa

Files: a51858b13e497beda1e5deb1c48381c361a0ccfa / 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