index.js 601 Bytes
Newer Older
1 2
import React from 'react';
import ReactDOM from 'react-dom';
3
import { createStore, applyMiddleware, compose } from 'redux'
baiguangyao committed
4 5
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
zhanghaozhe committed
6
import logger from 'redux-logger'
zhanghaozhe committed
7
import rootReducers from './store'
zhanghaozhe committed
8
import App from './App'
9

10 11 12

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

zhanghaozhe committed
13 14
const store = createStore(
    rootReducers,
15 16 17
    composeEnhancers(
        applyMiddleware(thunk, logger)
    )
zhanghaozhe committed
18 19
)

baiguangyao committed
20

baiguangyao committed
21
ReactDOM.render(
zhanghaozhe committed
22
    <Provider store={store}>
zhanghaozhe committed
23
        <App/>
zhanghaozhe committed
24 25
    </Provider>,
    document.getElementById('root'));