19 lines
581 B
TypeScript
19 lines
581 B
TypeScript
import { applyMiddleware, compose, createStore, Store } from 'redux';
|
|
import { routerMiddleware } from 'react-router-redux';
|
|
import { SagaMiddleware } from 'redux-saga';
|
|
import { History } from 'history';
|
|
|
|
import { reducer, State } from './configureRedux';
|
|
|
|
export default function configureStore(history: History, sagaMiddleware: SagaMiddleware<any>): Store<State> {
|
|
const middlewares = [sagaMiddleware, routerMiddleware(history)];
|
|
const store = createStore<State>(
|
|
reducer,
|
|
applyMiddleware(...middlewares),
|
|
);
|
|
|
|
// sagaMiddleware.run(rootSaga);
|
|
|
|
return store;
|
|
}
|