You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
597 B
17 lines
597 B
// @flow
|
|
import { createStore, applyMiddleware } from 'redux';
|
|
import thunk from 'redux-thunk';
|
|
import { createBrowserHistory } from 'history';
|
|
import { routerMiddleware } from 'react-router-redux';
|
|
import rootReducer from '../reducers';
|
|
import type { counterStateType } from '../reducers/counter';
|
|
|
|
const history = createBrowserHistory();
|
|
const router = routerMiddleware(history);
|
|
const enhancer = applyMiddleware(thunk, router);
|
|
|
|
function configureStore(initialState?: counterStateType) {
|
|
return createStore(rootReducer, initialState, enhancer);
|
|
}
|
|
|
|
export default { configureStore, history };
|
|
|