npm install --save redux-thunk
// 创建store
import {createStore, applyMiddleware, compose} from “redux”;
import red from ‘./reducer’;
import thunk from ‘redux-thunk’
// redux-thunk
const composeEnhancer = window.REDUX_DEVTOOLS_EXTENSION_COMPOSE ?
window.REDUX_DEVTOOLS_EXTENSION_COMPOSE({}) : compose()
const enhancer = composeEnhancer(applyMiddleware(thunk))
const store = createStore(
red, enhancer
)
export default store