yapi/client/index.js

33 lines
884 B
JavaScript
Raw Normal View History

2017-07-05 14:10:06 +08:00
import React from 'react'
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'
2017-07-24 11:04:51 +08:00
import App from './Application'
2017-08-04 12:15:45 +08:00
import { createStore, combineReducers, applyMiddleware, compose } 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-08-04 12:15:45 +08:00
import { DevTools } from './containers';
const enhancer = compose(
// Middleware you want to use in development:
applyMiddleware(
thunkMiddleware.default,
promiseMiddleware
),
// Required! Enable Redux DevTools with the monitors you chose
DevTools.instrument()
);
2017-07-09 21:33:21 +08:00
// 合并 redux 创建stroe
2017-08-04 12:15:45 +08:00
const store = createStore(combineReducers( ReduxContainer ), {}, enhancer)
2017-07-05 14:10:06 +08:00
ReactDOM.render(
2017-07-09 21:33:21 +08:00
<Provider store={store}>
2017-08-04 12:15:45 +08:00
<div>
<App />
<DevTools />
</div>
2017-07-09 21:33:21 +08:00
</Provider>,
2017-07-05 14:10:06 +08:00
document.getElementById('yapi')
2017-07-09 21:33:21 +08:00
)