0e10c3f984
* Version Bump * local search skeleton * Added WaitService middleware * Return matching queries * wait action middleware rename/refactor * bigger debounce time * Fix: Initialize state using Immutable * Local Search without integrations * Local Search refactor: Keep state in closure, recurse * “string” should be treated as the default widget by the inference. Closes #199
22 lines
802 B
JavaScript
22 lines
802 B
JavaScript
import { createStore, applyMiddleware, compose } from 'redux';
|
|
import thunkMiddleware from 'redux-thunk';
|
|
import waitUntilAction from './middleware/waitUntilAction';
|
|
import reducer from '../reducers/combinedReducer';
|
|
|
|
export default function configureStore(initialState) {
|
|
const store = createStore(reducer, initialState, compose(
|
|
applyMiddleware(thunkMiddleware, waitUntilAction),
|
|
window.devToolsExtension ? window.devToolsExtension() : f => f
|
|
));
|
|
|
|
if (process.env.NODE_ENV !== 'production' && module.hot) {
|
|
// Enable Webpack hot module replacement for reducers
|
|
module.hot.accept('../reducers/combinedReducer', () => {
|
|
const nextReducer = require('../reducers/combinedReducer') // eslint-disable-line
|
|
store.replaceReducer(nextReducer);
|
|
});
|
|
}
|
|
|
|
return store;
|
|
}
|