2021-02-04 19:15:23 +01:00
|
|
|
import { createStore, applyMiddleware } from 'redux';
|
|
|
|
import thunkMiddleware from 'redux-thunk';
|
|
|
|
import { composeWithDevTools } from 'remote-redux-devtools';
|
|
|
|
import rootReducer from '../ducks';
|
2016-04-14 00:28:44 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
export default function configureStore(initialState) {
|
2021-12-06 16:25:40 +01:00
|
|
|
let storeEnhancers = applyMiddleware(thunkMiddleware);
|
|
|
|
|
|
|
|
if (process.env.METAMASK_DEBUG && !process.env.IN_TEST) {
|
|
|
|
const composeEnhancers = composeWithDevTools({
|
|
|
|
name: 'MetaMask',
|
|
|
|
hostname: 'localhost',
|
|
|
|
port: 8000,
|
|
|
|
realtime: Boolean(process.env.METAMASK_DEBUG),
|
|
|
|
});
|
|
|
|
storeEnhancers = composeEnhancers(storeEnhancers);
|
|
|
|
}
|
|
|
|
|
|
|
|
return createStore(rootReducer, initialState, storeEnhancers);
|
2016-04-14 00:28:44 +02:00
|
|
|
}
|