阅读 3

redux-devtools 配置

src/store/index.js

import { createStore , compose, applyMiddleware} from 'redux';
import reducer from './reducer';
import reactSaga from 'redux-saga';

//生成store对象
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, composeEnhancers(
    applyMiddleware(reactSaga)
)); //内部会第一次调用reducer函数,得到初始state 

export default store;

复制代码
关注下面的标签,发现更多相似文章
评论