17 lines
425 B
JavaScript
17 lines
425 B
JavaScript
![]() |
import { createStore as reduxCreateStore, applyMiddleware } from 'redux';
|
||
|
import createSagaMiddleware from 'redux-saga';
|
||
|
|
||
|
import rootReducer from './rootReducer';
|
||
|
import rootSaga from './rootSaga';
|
||
|
|
||
|
const sagaMiddleware = createSagaMiddleware();
|
||
|
|
||
|
export const createStore = () => {
|
||
|
const store = reduxCreateStore(
|
||
|
rootReducer,
|
||
|
applyMiddleware(sagaMiddleware)
|
||
|
);
|
||
|
sagaMiddleware.run(rootSaga);
|
||
|
return store;
|
||
|
};
|