mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
adding some comments about devtool hook up
This commit is contained in:
@@ -2,10 +2,14 @@ import { reducer } from './reducers';
|
||||
import { createStore, compose } from 'redux';
|
||||
import { addTodo } from './actions';
|
||||
|
||||
/* Goop for making the Redux dev tool to work */
|
||||
declare var window: any;
|
||||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
||||
function createStoreWithDevTool(reducer, initialStore) {
|
||||
return createStore(reducer, initialStore, composeEnhancers());
|
||||
}
|
||||
|
||||
const store = createStore(reducer, {}, composeEnhancers());
|
||||
const store = createStoreWithDevTool(reducer, {});
|
||||
|
||||
console.log(store.getState());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user