Intégration de github.com/zalmoxisus/redux-devtools-extension

This commit is contained in:
wpetit 2020-05-19 17:20:31 +02:00
parent 3fa2b5905a
commit 9dce43fd58

View File

@ -1,4 +1,4 @@
import { createStore, applyMiddleware } from 'redux'
import { createStore, applyMiddleware, compose } from 'redux'
import createSagaMiddleware from 'redux-saga'
import { rootReducer } from './reducers/root'
import { rootSaga } from './sagas/root'
@ -14,6 +14,8 @@ if (process.env.NODE_ENV !== 'production') {
reduxMiddlewares.push(loggerMiddleware);
}
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
// create the saga middleware
const sagaMiddleware = createSagaMiddleware()
reduxMiddlewares.push(sagaMiddleware);
@ -21,7 +23,7 @@ reduxMiddlewares.push(sagaMiddleware);
// mount it on the Store
export const store = createStore(
rootReducer,
applyMiddleware(...reduxMiddlewares)
composeEnhancers(applyMiddleware(...reduxMiddlewares)),
)
// then run the saga