1. // store/index.js
    2. /*
    3. redux最核心的管理对象模块
    4. */
    5. import { createStore, applyMiddleware } from 'redux'
    6. import thunk from 'redux-thunk'
    7. import { composeWithDevTools } from 'redux-devtools-extension'
    8. import reducers from './reducers'
    9. // 向外暴露store对象
    10. export default createStore(
    11. reducers,
    12. composeWithDevTools(applyMiddleware(thunk))
    13. )
    1. import { createStore, applyMiddleware, compose } from 'redux'
    2. import reducer from './reducers' // 管理员
    3. import thunk from 'redux-thunk'
    4. const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
    5. ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({})
    6. : compose
    7. const enhancer = composeEnhancer(applyMiddleware(thunk))
    8. const store = createStore(
    9. reducer,
    10. // window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() // redux
    11. // applyMiddleware(thunk) // thunk
    12. enhancer
    13. )
    14. export default store

    https://github.com/zalmoxisus/redux-devtools-extension