insomnia/app/ui/redux/create.js
Louis St-Amour 6a391268e5 Adding react and redux dev tools (#327)
* Adding react & redux dev tools

To dev builds, using electron-devtools-installer

* Corrected lint error

* Updating package-lock.
2017-07-20 12:09:07 -07:00

26 lines
802 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {createStore, applyMiddleware, compose} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {reducer} from './modules';
export default function () {
const composeEnhancers =
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extensions options like name, actionsBlacklist, actionsCreators, serialize...
}) : compose;
const middleware = [thunkMiddleware];
const enhancer = composeEnhancers(
applyMiddleware(...middleware),
// other store enhancers if any
);
const store = createStore(reducer, enhancer);
if (__DEV__ && module.hot) {
module.hot.accept('./modules/index', () => {
store.replaceReducer(reducer);
});
}
return store;
}