24 lines
631 B
JavaScript
24 lines
631 B
JavaScript
import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
|
|
import createSagaMiddleware from 'redux-saga'
|
|
import rootSaga from '../sagas/root'
|
|
|
|
const sagaMiddleware = createSagaMiddleware()
|
|
|
|
const rootReducer = combineReducers({
|
|
// Ajouter vos reducers ici
|
|
});
|
|
|
|
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
|
|
|
export function configureStore(initialState = {}) {
|
|
const store = createStore(
|
|
rootReducer,
|
|
initialState,
|
|
composeEnhancers(
|
|
applyMiddleware(sagaMiddleware)
|
|
)
|
|
)
|
|
sagaMiddleware.run(rootSaga);
|
|
return store;
|
|
}
|