adding some comments about devtool hook up

This commit is contained in:
Ken Chau
2019-02-16 17:06:30 -08:00
parent 7fc326b0cb
commit 64bd766619
2 changed files with 6 additions and 1 deletions

View File

@@ -2,5 +2,6 @@
"prettier.printWidth": 140,
"prettier.tabWidth": 2,
"prettier.singleQuote": true,
"editor.tabSize": 2,
"editor.formatOnSave": true
}

View File

@@ -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());