summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/redux/configureStore.js
diff options
context:
space:
mode:
authorDayana31 <[email protected]>2022-06-01 16:43:23 -0500
committerDayana31 <[email protected]>2022-06-01 16:43:23 -0500
commitec0c33156713e51c64f2a9de4f932cd5507c654b (patch)
treecc46421686a49bbc0a0c343e460c13a21af1015d /front/odiparpack/app/redux/configureStore.js
parent6971201caffc2fccee5bfb12e88e5510c85eeb49 (diff)
parente9cb09907f8dbc9a4a64549a3ea4d1d8313e7c25 (diff)
downloadDP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.gz
DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.bz2
DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.zip
Merge branch 'develop' into dayana
Diffstat (limited to 'front/odiparpack/app/redux/configureStore.js')
-rw-r--r--front/odiparpack/app/redux/configureStore.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/front/odiparpack/app/redux/configureStore.js b/front/odiparpack/app/redux/configureStore.js
index 49a6b7b..767af03 100644
--- a/front/odiparpack/app/redux/configureStore.js
+++ b/front/odiparpack/app/redux/configureStore.js
@@ -7,14 +7,16 @@ import { fromJS } from 'immutable';
import { routerMiddleware } from 'connected-react-router/immutable';
import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';
+import thunk from 'redux-thunk';
+import { composeWithDevTools } from "redux-devtools-extension";
const sagaMiddleware = createSagaMiddleware();
-export default function configureStore(initialState = {}, history) {
+export function configureStore(initialState = {}, history) {
// Create the store with two middlewares
// 1. sagaMiddleware: Makes redux-sagas work
// 2. routerMiddleware: Syncs the location/URL path to the state
- const middlewares = [sagaMiddleware, routerMiddleware(history)];
+ const middlewares = [thunk, routerMiddleware(history)];
const enhancers = [applyMiddleware(...middlewares)];
@@ -29,17 +31,18 @@ export default function configureStore(initialState = {}, history) {
shouldHotReload: false,
})
: compose;
+
/* eslint-enable */
const store = createStore(
createReducer(),
fromJS(initialState),
- composeEnhancers(...enhancers),
+ composeWithDevTools(applyMiddleware(thunk))
);
// Extensions
- store.runSaga = sagaMiddleware.run;
+ //store.runSaga = sagaMiddleware.run;
store.injectedReducers = {}; // Reducer registry
- store.injectedSagas = {}; // Saga registry
+ //store.injectedSagas = {}; // Saga registry
// Make reducers hot reloadable, see http://mxs.is/googmo
/* istanbul ignore next */
@@ -51,3 +54,12 @@ export default function configureStore(initialState = {}, history) {
return store;
}
+
+export function confStore (){
+ const store = createStore(
+ createReducer(),
+ composeWithDevTools(applyMiddleware(thunk))
+ );
+ store.injectedReducers = {};
+ return store;
+}