diff --git a/docs/api/configureStore.md b/docs/api/configureStore.md index a5969142cd..5db796496a 100644 --- a/docs/api/configureStore.md +++ b/docs/api/configureStore.md @@ -52,7 +52,7 @@ For more details on how the `middleware` parameter works and the list of middlew ### `devTools` -If this is a boolean, it will be used to indicate whether `configureStore` should automatically enable support for [the Redux DevTools browser extension](https://github.com/zalmoxisus/redux-devtools-extension). +If this is a boolean, it will be used to indicate whether `configureStore` should automatically enable support for [the Redux DevTools browser extension](https://github.com/zalmoxisus/redux-devtools-extension). If it is an object of `redux-devtools-extension` [`EnhancerOptions`](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#windowdevtoolsextensionconfig), `configureStore` will use the user provided configuration options. diff --git a/docs/usage/usage-guide.md b/docs/usage/usage-guide.md index 7826a7d11b..a6b75357cd 100644 --- a/docs/usage/usage-guide.md +++ b/docs/usage/usage-guide.md @@ -183,19 +183,19 @@ With `createReducer`, we can shorten that example considerably: ```js const todosReducer = createReducer([], { - "ADD_TODO" : (state, action) => { - // "mutate" the array by calling push() - state.push(action.payload); - }, - "TOGGLE_TODO" : (state, action) => { - const todo = state[action.payload.index]; - // "mutate" the object by overwriting a field - todo.completed = !todo.completed; - }, - "REMOVE_TODO" : (state, action) => { - // Can still return an immutably-updated value if we want to - return state.filter( (todo, i) => i !== action.payload.index) - } + ADD_TODO: (state, action) => { + // "mutate" the array by calling push() + state.push(action.payload) + }, + TOGGLE_TODO: (state, action) => { + const todo = state[action.payload.index] + // "mutate" the object by overwriting a field + todo.completed = !todo.completed + }, + REMOVE_TODO: (state, action) => { + // Can still return an immutably-updated value if we want to + return state.filter((todo, i) => i !== action.payload.index) + } }) ``` diff --git a/src/configureStore.test.ts b/src/configureStore.test.ts index 7721824282..29ba380f0d 100644 --- a/src/configureStore.test.ts +++ b/src/configureStore.test.ts @@ -124,8 +124,8 @@ describe('configureStore', () => { it('calls createStore with devTools enhancer and option', () => { const options = { name: 'myApp', - trace: true, - }; + trace: true + } expect(configureStore({ devTools: options, reducer })).toBeInstanceOf( Object ) diff --git a/src/configureStore.ts b/src/configureStore.ts index 1354989c0d..80ab21a8af 100644 --- a/src/configureStore.ts +++ b/src/configureStore.ts @@ -136,7 +136,7 @@ export function configureStore( finalCompose = composeWithDevTools({ // Enable capture of stack traces for dispatched Redux actions trace: !IS_PRODUCTION, - ...typeof devTools === 'object' && devTools, + ...(typeof devTools === 'object' && devTools) }) }