mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
添加中间件
This commit is contained in:
parent
ef337dc18d
commit
3cf7190745
@ -1,13 +1,21 @@
|
||||
import React from 'react'
|
||||
import 'babel-polyfill'
|
||||
import thunkMiddleware from 'redux-thunk'
|
||||
import promiseMiddleware from 'redux-promise';
|
||||
import ReactDOM from 'react-dom'
|
||||
import App from './App'
|
||||
import { createStore, combineReducers } from 'redux'
|
||||
import { createStore, combineReducers, applyMiddleware } from 'redux'
|
||||
import { Provider } from 'react-redux'
|
||||
import ReduxContainer from './ReduxContainer.js'
|
||||
|
||||
console.log('thunkMiddleware', thunkMiddleware)
|
||||
console.log('promiseMiddleware', promiseMiddleware)
|
||||
|
||||
// 合并 redux 创建stroe
|
||||
const store = createStore(combineReducers( ReduxContainer ))
|
||||
const store = createStore(combineReducers( ReduxContainer ), applyMiddleware(
|
||||
thunkMiddleware.default,
|
||||
promiseMiddleware
|
||||
))
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
|
@ -31,8 +31,9 @@
|
||||
"mongoose-auto-increment": "^5.0.1",
|
||||
"node-sass-china": "^4.5.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"sha1": "^1.1.1",
|
||||
"redux": "^3.7.1",
|
||||
"redux-promise": "^0.5.3",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"sha1": "^1.1.1",
|
||||
"ykit-config-antd": "^0.1.3",
|
||||
"ykit-config-react": "^0.4.4"
|
||||
|
Loading…
Reference in New Issue
Block a user