Skip to content

Commit 828970f

Browse files
authored
Merge pull request #4 from nickmccurdy/fix-3
Enable Redux devtools by default (fix #3)
2 parents 2391849 + 60c3dbf commit 828970f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ function configureStore({
4040
reducer: Object<string, Function> | Function,
4141
// An array of Redux middlewares. If not supplied, defaults to just redux-thunk.
4242
middleware: Array<MiddlewareFunction>,
43-
// Built-in support for devtools.
44-
// Defaults to NODE_ENV !== production
43+
// Built-in support for devtools. Defaults to true.
4544
devTools: boolean,
4645
// Same as current createStore.
4746
preloadedState : State,
@@ -59,7 +58,7 @@ import {configureStore} from "@acemarke/redux-starter-kit";
5958
import rootReducer from "./reducers";
6059

6160
const store = configureStore(rootReducer);
62-
// The store now has redux-thunk added, and if in dev, the Redux DevTools Extension is turned on
61+
// The store now has redux-thunk added and the Redux DevTools Extension is turned on
6362
```
6463

6564
Full example:
@@ -98,15 +97,15 @@ const preloadedState = {
9897
const store = configureStore({
9998
reducer,
10099
middleware,
101-
devTools : true,
100+
devTools : NODE_ENV !== 'production',
102101
preloadedState,
103102
enhancers : [reduxBatch],
104103
});
105104

106105
// The store has been created with these options:
107106
// - The slice reducers were automatically passed to combineReducers()
108107
// - redux-thunk and redux-logger were added as middleware
109-
// - The Redux DevTools Extension is enabled for both development and production
108+
// - The Redux DevTools Extension is disabled for production
110109
// - The middleware, batch, and devtools enhancers were automatically composed together
111110
```
112111

src/configureStore.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import thunk from "redux-thunk";
44

55
import isPlainObject from "./isPlainObject";
66

7-
const IS_DEVELOPMENT = process.env.NODE_ENV !== "production";
8-
97
export function createDefaultMiddleware(...additional) {
108
return [thunk, ...additional];
119
}
@@ -14,7 +12,7 @@ export function configureStore(options = {}) {
1412
const {
1513
reducer,
1614
middleware = createDefaultMiddleware(),
17-
devTools = IS_DEVELOPMENT,
15+
devTools = true,
1816
preloadedState,
1917
enhancers = [],
2018
} = options;

0 commit comments

Comments
 (0)