React-安裝和配置redux調試工具Redux DevTools

chrome擴展程序裏搜索Redux DevTools進行安裝chrome

新建store的時候,進行以下配置。redux

import { createStore, applyMiddleware ,compose} from 'redux';
import reducer from './reducer'
import thunk from 'redux-thunk'
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?   window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;
const store=createStore(reducer,composeEnhancers(applyMiddleware(thunk)));
export default store;
相關文章
相關標籤/搜索