Skip to content

Commit 8709312

Browse files
authored
Merge pull request #64 from reduxjs/action-stack-traces
Action stack traces
2 parents a4b621d + b971340 commit 8709312

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"immer": "^1.1.3",
4444
"redux": "^4.0.0",
45-
"redux-devtools-extension": "^2.13.3",
45+
"redux-devtools-extension": "^2.13.7",
4646
"redux-immutable-state-invariant": "^2.1.0",
4747
"redux-thunk": "^2.2.0",
4848
"selectorator": "^3.3.0"

src/configureStore.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ export function configureStore(options = {}) {
4545

4646
const middlewareEnhancer = applyMiddleware(...middleware)
4747

48-
const storeEnhancers = [middlewareEnhancer, ...enhancers]
48+
let finalCompose = compose
49+
50+
if(devTools) {
51+
finalCompose = composeWithDevTools({
52+
// Enable capture of stack traces for dispatched Redux actions
53+
trace : !IS_PRODUCTION
54+
})
55+
}
4956

50-
let finalCompose = devTools ? composeWithDevTools : compose
57+
const storeEnhancers = [middlewareEnhancer, ...enhancers]
5158

5259
const composedEnhancer = finalCompose(...storeEnhancers)
5360

0 commit comments

Comments
 (0)