Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Apr 28, 2019
1 parent 3a0dee6 commit 9e80566
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/api/configureStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
26 changes: 13 additions & 13 deletions docs/usage/usage-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
```

Expand Down
4 changes: 2 additions & 2 deletions src/configureStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion src/configureStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function configureStore<S = any, A extends Action = AnyAction>(
finalCompose = composeWithDevTools({
// Enable capture of stack traces for dispatched Redux actions
trace: !IS_PRODUCTION,
...typeof devTools === 'object' && devTools,
...(typeof devTools === 'object' && devTools)
})
}

Expand Down

0 comments on commit 9e80566

Please sign in to comment.