2017-07-05 14:10:06 +08:00
|
|
|
import React from 'react'
|
2017-07-11 10:22:06 +08:00
|
|
|
import 'babel-polyfill'
|
2017-07-12 11:39:06 +08:00
|
|
|
import thunkMiddleware from 'redux-thunk'
|
|
|
|
import promiseMiddleware from 'redux-promise';
|
2017-07-05 14:10:06 +08:00
|
|
|
import ReactDOM from 'react-dom'
|
|
|
|
import App from './App'
|
2017-07-12 11:39:06 +08:00
|
|
|
import { createStore, combineReducers, applyMiddleware } from 'redux'
|
2017-07-10 20:30:11 +08:00
|
|
|
import { Provider } from 'react-redux'
|
2017-07-09 21:47:19 +08:00
|
|
|
import ReduxContainer from './ReduxContainer.js'
|
2017-07-09 21:33:21 +08:00
|
|
|
|
|
|
|
// 合并 redux 创建stroe
|
2017-07-12 11:39:06 +08:00
|
|
|
const store = createStore(combineReducers( ReduxContainer ), applyMiddleware(
|
|
|
|
thunkMiddleware.default,
|
|
|
|
promiseMiddleware
|
|
|
|
))
|
2017-07-05 14:10:06 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
2017-07-09 21:33:21 +08:00
|
|
|
<Provider store={store}>
|
|
|
|
<App />
|
|
|
|
</Provider>,
|
2017-07-05 14:10:06 +08:00
|
|
|
document.getElementById('yapi')
|
2017-07-09 21:33:21 +08:00
|
|
|
)
|