Skip to content

Commit

Permalink
Merge pull request #14 from arhontmw/devtools-options
Browse files Browse the repository at this point in the history
  • Loading branch information
pofigizm authored Nov 16, 2020
2 parents 91aaa5a + 6823c99 commit 7d5f260
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-dynamic",
"version": "1.3.0",
"version": "1.3.1",
"description": "Allow add or remove redux modules dynamically",
"main": "lib/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/configure-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { createStore, applyMiddleware, compose } from 'redux'
const configureStore = ({
name,
withDevTools,
devToolsOptions,
initial,
reducer,
dynamicMiddlewares,
}) => {
const middlewares = applyMiddleware(dynamicMiddlewares)
// eslint-disable-next-line no-underscore-dangle
const devTools = withDevTools && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
const composeEnhancers = devTools ? devTools({ name }) : compose
const composeEnhancers = devTools ? devTools({ name, ...(devToolsOptions || {}) }) : compose
const enhancers = composeEnhancers(middlewares)
const store = createStore(reducer, initial, enhancers)

Expand Down
2 changes: 2 additions & 0 deletions src/create-instance-flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const createInstanceFlat = ({
reducer = emptyReducer,
middleware = emptyMiddleware,
withDevTools,
devToolsOptions,
} = {}) => {
const dynamicMiddlewares = createDynamicMiddlewares()
const reducerWrapper = reducer.wrapper ? reducer.wrapper : combineReducers
Expand All @@ -42,6 +43,7 @@ const createInstanceFlat = ({
const store = configureStore({
name,
withDevTools,
devToolsOptions,
key,
initial,
reducer: reducerInitial,
Expand Down
2 changes: 2 additions & 0 deletions src/create-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const createInstance = ({
reducer = emptyReducer,
middleware = emptyMiddleware,
withDevTools,
devToolsOptions,
} = {}) => {
const dynamicMiddlewares = createDynamicMiddlewares()
const registry = {
Expand All @@ -38,6 +39,7 @@ const createInstance = ({
const store = configureStore({
name,
withDevTools,
devToolsOptions,
key,
reducer: emptyReducer,
dynamicMiddlewares: dynamicMiddlewares.enhancer,
Expand Down

0 comments on commit 7d5f260

Please sign in to comment.