mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Merge pull request #20 from sharetribe/enable-redux-devtools
Enable Redux DevTools in client side dev mode
This commit is contained in:
commit
98030f0aaa
1 changed files with 7 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-underscore-dangle */
|
||||
import { createStore } from 'redux';
|
||||
import createReducer from './reducers';
|
||||
|
||||
|
|
@ -6,5 +7,11 @@ import createReducer from './reducers';
|
|||
* (like redux-saga or redux-thunk middleware)
|
||||
*/
|
||||
export default function configureStore(initialState) {
|
||||
const useReduxDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' &&
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__;
|
||||
|
||||
if (useReduxDevTools) {
|
||||
return createStore(createReducer(), initialState, window.__REDUX_DEVTOOLS_EXTENSION__());
|
||||
}
|
||||
return createStore(createReducer(), initialState);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue